7
7
8
8
[ ![ NPM version] [ npm-image ]] [ npm-url ] [ ![ Downloads] [ downloads-image ]] [ npm-url ] [ ![ Dependency Status] [ david-badge ]] [ david-badge-url ]
9
9
<a href =" #badge " >
10
- <img alt =" code style: prettier " src =" https://img.shields.io/badge/code_style-prettier-ff69b4.svg " >
10
+ <img alt =" code style: prettier " src =" https://img.shields.io/badge/code_style-prettier-ff69b4.svg " >
11
11
</a >
12
12
13
13
# Executor for [ Runnerty] : HTTP
14
14
15
15
### Installation:
16
+
16
17
Through NPM
17
18
18
19
``` bash
@@ -34,7 +35,9 @@ rty add @runnerty/executor-http
34
35
```
35
36
36
37
### Configuration sample:
38
+
37
39
Add in [ config.json] :
40
+
38
41
``` json
39
42
{
40
43
"id" : " http_default" ,
@@ -43,24 +46,26 @@ Add in [config.json]:
43
46
```
44
47
45
48
### Plan sample:
49
+
46
50
Add in [ plan.json] :
51
+
47
52
``` json
48
53
{
49
54
"id" : " http_default" ,
50
- "headers" : {"User-Agent" : " runnerty" },
55
+ "headers" : { "User-Agent" : " runnerty" },
51
56
"method" : " get" ,
52
57
"url" : " https://api.github.com/search/repositories" ,
53
- "params" :{ "q" : " runnerty" },
58
+ "params" : { "q" : " runnerty" },
54
59
"responseType" : " json"
55
60
}
56
61
```
57
62
58
63
``` json
59
64
{
60
65
"id" : " http_default" ,
61
- "headers" : {"User-Agent" : " runnerty" },
66
+ "headers" : { "User-Agent" : " runnerty" },
62
67
"url" : " http://www.sample.com/form" ,
63
- "method" :" post" ,
68
+ "method" : " post" ,
64
69
"data" : {
65
70
"key1" : " value1" ,
66
71
"key2" : " value2"
@@ -76,8 +81,10 @@ Add in [plan.json]:
76
81
"headers" : { "User-Agent" : " runnerty" },
77
82
"url" : " http://www.sample.com/uploadfile" ,
78
83
"method" : " post" ,
79
- "files" :[{"name" :" fileOne" , "path" :" /var/myfile.txt" },
80
- {"name" :" fileTwo" , "path" :" /var/www/runnerty.jpg" }],
84
+ "files" : [
85
+ { "name" : " fileOne" , "path" : " /var/myfile.txt" },
86
+ { "name" : " fileTwo" , "path" : " /var/www/runnerty.jpg" }
87
+ ],
81
88
"responseType" : " json" ,
82
89
"returnHeaderDataOutput" : true
83
90
}
@@ -98,8 +105,10 @@ Add in [plan.json]:
98
105
```
99
106
100
107
### Pagination:
108
+
101
109
It is possible to make calls to APIs that return ` JSON ` data that requires paging.
102
110
The parameters available for paging are:
111
+
103
112
```
104
113
start - page from which the query is initiated, by default 1
105
114
limit - maximum elements per page
@@ -113,7 +122,9 @@ token.data_param_name - name of the parameter to be sent in the body w
113
122
token.next_token_from_response - params path of the response data from which to get the next page token
114
123
token.next_token_from_header - params path of the header data from which to get the next page token
115
124
```
125
+
116
126
Some paginations examples:
127
+
117
128
``` json
118
129
{
119
130
"id" : " http_default" ,
@@ -128,6 +139,7 @@ Some paginations examples:
128
139
"noReturnDataOutput" : true
129
140
}
130
141
```
142
+
131
143
``` json
132
144
{
133
145
"id" : " http_default" ,
@@ -142,6 +154,7 @@ Some paginations examples:
142
154
"noReturnDataOutput" : true
143
155
}
144
156
```
157
+
145
158
``` json
146
159
{
147
160
"id" : " http_default" ,
@@ -161,9 +174,11 @@ Some paginations examples:
161
174
```
162
175
163
176
### Output (Process values):
164
- * ` PROCESS_EXEC_DATA_OUTPUT ` : Response output data.
165
- It is possible to return the header response in dataoutput by activating the ` returnHeaderDataOutput (boolean) ` parameter
166
- * ` EXTRA_DATA ` : If the response is a ` JSON ` it is possible to work with the parsed values of the response using the ` "responseType": "json" ` parameter. If we receive for example:
177
+
178
+ - ` PROCESS_EXEC_DATA_OUTPUT ` : Response output data.
179
+ It is possible to return the header response in dataoutput by activating the ` returnHeaderDataOutput (boolean) ` parameter
180
+ - ` EXTRA_DATA ` : If the response is a ` JSON ` it is possible to work with the parsed values of the response using the ` "responseType": "json" ` parameter. If we receive for example:
181
+
167
182
``` json
168
183
{
169
184
"planet" : {
@@ -179,10 +194,11 @@ It is possible to return the header response in dataoutput by activating the `re
179
194
}
180
195
}
181
196
```
197
+
182
198
It is possible to access the values by ([ GETVALUE] function):
183
199
` PROCESS_EXEC_PLANET_NAME ` : "Mars", ` PROCESS_EXEC_PLANET_NAME_SATELLITES_1_NAME ` :"phobos"
184
200
185
- * ` PROCESS_EXEC_ERR_OUTPUT ` : Error output message.
201
+ - ` PROCESS_EXEC_ERR_OUTPUT ` : Error output message.
186
202
187
203
### Other considerations
188
204
@@ -199,13 +215,13 @@ If the result is very large, you should consider using the "noReturnDataOutput"
199
215
}
200
216
```
201
217
202
- [ Runnerty ] : http://www.runnerty.io
218
+ [ runnerty ] : http://www.runnerty.io
203
219
[ downloads-image ] : https://img.shields.io/npm/dm/@runnerty/executor-http.svg
204
220
[ npm-url ] : https://www.npmjs.com/package/@runnerty/executor-http
205
221
[ npm-image ] : https://img.shields.io/npm/v/@runnerty/executor-http.svg
206
222
[ david-badge ] : https://david-dm.org/runnerty/executor-http.svg
207
223
[ david-badge-url ] : https://david-dm.org/runnerty/executor-http
208
- [ GETVALUE ] : http://docs.runnerty.io/functions/
224
+ [ getvalue ] : http://docs.runnerty.io/functions/
209
225
[ config.json ] : http://docs.runnerty.io/config/
210
226
[ plan.json ] : http://docs.runnerty.io/plan/
211
- [ runnerty-cli ] : https://www.npmjs.com/package/runnerty-cli
227
+ [ runnerty-cli ] : https://www.npmjs.com/package/runnerty-cli
0 commit comments