77
88[ ![ NPM version] [ npm-image ]] [ npm-url ] [ ![ Downloads] [ downloads-image ]] [ npm-url ] [ ![ Dependency Status] [ david-badge ]] [ david-badge-url ]
99<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 " >
1111</a >
1212
1313# Executor for [ Runnerty] : HTTP
1414
1515### Installation:
16+
1617Through NPM
1718
1819``` bash
@@ -34,7 +35,9 @@ rty add @runnerty/executor-http
3435```
3536
3637### Configuration sample:
38+
3739Add in [ config.json] :
40+
3841``` json
3942{
4043 "id" : " http_default" ,
@@ -43,24 +46,26 @@ Add in [config.json]:
4346```
4447
4548### Plan sample:
49+
4650Add in [ plan.json] :
51+
4752``` json
4853{
4954 "id" : " http_default" ,
50- "headers" : {"User-Agent" : " runnerty" },
55+ "headers" : { "User-Agent" : " runnerty" },
5156 "method" : " get" ,
5257 "url" : " https://api.github.com/search/repositories" ,
53- "params" :{ "q" : " runnerty" },
58+ "params" : { "q" : " runnerty" },
5459 "responseType" : " json"
5560}
5661```
5762
5863``` json
5964{
6065 "id" : " http_default" ,
61- "headers" : {"User-Agent" : " runnerty" },
66+ "headers" : { "User-Agent" : " runnerty" },
6267 "url" : " http://www.sample.com/form" ,
63- "method" :" post" ,
68+ "method" : " post" ,
6469 "data" : {
6570 "key1" : " value1" ,
6671 "key2" : " value2"
@@ -76,8 +81,10 @@ Add in [plan.json]:
7681 "headers" : { "User-Agent" : " runnerty" },
7782 "url" : " http://www.sample.com/uploadfile" ,
7883 "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+ ],
8188 "responseType" : " json" ,
8289 "returnHeaderDataOutput" : true
8390}
@@ -98,8 +105,10 @@ Add in [plan.json]:
98105```
99106
100107### Pagination:
108+
101109It is possible to make calls to APIs that return ` JSON ` data that requires paging.
102110The parameters available for paging are:
111+
103112```
104113start - page from which the query is initiated, by default 1
105114limit - maximum elements per page
@@ -113,7 +122,9 @@ token.data_param_name - name of the parameter to be sent in the body w
113122token.next_token_from_response - params path of the response data from which to get the next page token
114123token.next_token_from_header - params path of the header data from which to get the next page token
115124```
125+
116126Some paginations examples:
127+
117128``` json
118129{
119130 "id" : " http_default" ,
@@ -128,6 +139,7 @@ Some paginations examples:
128139 "noReturnDataOutput" : true
129140}
130141```
142+
131143``` json
132144{
133145 "id" : " http_default" ,
@@ -142,6 +154,7 @@ Some paginations examples:
142154 "noReturnDataOutput" : true
143155}
144156```
157+
145158``` json
146159{
147160 "id" : " http_default" ,
@@ -161,9 +174,11 @@ Some paginations examples:
161174```
162175
163176### 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+
167182``` json
168183{
169184 "planet" : {
@@ -179,10 +194,11 @@ It is possible to return the header response in dataoutput by activating the `re
179194 }
180195}
181196```
197+
182198It is possible to access the values by ([ GETVALUE] function):
183199` PROCESS_EXEC_PLANET_NAME ` : "Mars", ` PROCESS_EXEC_PLANET_NAME_SATELLITES_1_NAME ` :"phobos"
184200
185- * ` PROCESS_EXEC_ERR_OUTPUT ` : Error output message.
201+ - ` PROCESS_EXEC_ERR_OUTPUT ` : Error output message.
186202
187203### Other considerations
188204
@@ -199,13 +215,13 @@ If the result is very large, you should consider using the "noReturnDataOutput"
199215}
200216```
201217
202- [ Runnerty ] : http://www.runnerty.io
218+ [ runnerty ] : http://www.runnerty.io
203219[ downloads-image ] : https://img.shields.io/npm/dm/@runnerty/executor-http.svg
204220[ npm-url ] : https://www.npmjs.com/package/@runnerty/executor-http
205221[ npm-image ] : https://img.shields.io/npm/v/@runnerty/executor-http.svg
206222[ david-badge ] : https://david-dm.org/runnerty/executor-http.svg
207223[ david-badge-url ] : https://david-dm.org/runnerty/executor-http
208- [ GETVALUE ] : http://docs.runnerty.io/functions/
224+ [ getvalue ] : http://docs.runnerty.io/functions/
209225[ config.json ] : http://docs.runnerty.io/config/
210226[ 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