http(a,b,c,d,e,f,g,h,i,j,k,l,m,n)
Group |
Executes HTTP requests with HTTP methods like GET, POST, DELETE or PUT and returns the HTTP status. Request headers can be set.
The response data and headers can be stored in a map and a file.
Parameter Descriptions
Additionally, you can use HTTP channels and certificates for authentication. To do so, specify the HTTP channel ID in parameter h and, if necessary, the certificate ID in parameter i.
Parameter |
Description |
||
a |
URL without query. |
||
b |
(optional) true for execution via DMZ. Default: false |
||
c |
Query. |
||
d |
Data for PUT/POST. Note: If parameter f contains the value multipart/form-data, d is evaluated as map name. All entries of this map (key, value) will be transformed into multipart attachments. Allowed methods in g are POST and PUT. If an incorrect method is set, the system automatically switches to POST. If the key begins with prefix file:, the following syntax has to be used.
The value to such a key is either
or the actual content of the file, which will be passed on in UTF-8 encoding. The file name of the key string is optional, if the value refers to a file - in that case, the real file name (without path) is used. Example: Key: file:testfile:phone.pdf:application/pdf Value: file:./conf/data/communication_list.pdf See also section HTTP (Input Agent Cron). |
||
e |
(optional) Encoding. Default: System encoding. |
||
f |
MIME type for PUT/POST. Note: If the value multipart/form-data is specified here, parameter d is evaluated as a map name (see there). |
||
g |
The HTTP method to be used. Allowed values: PUT, POST, PATCH, HEAD, DELETE, GET. |
||
h |
(optional) HTTP channel ID (if authentication is needed) or empty. The user is taken from field Own ID and the password from field Own password . |
||
i |
(optional) Certificate ID (if necessary) or empty. |
||
j |
(optional) Timeout in seconds. Default: 90 |
||
k |
(optional) Amount of retries. Default: 0 |
||
l |
(optional) Name of a map, into which the response headers and response data are to be saved → See section HTTP Response Headers and Data for details. It is also possible to add request headers → See section HTTP Request Headers for details. |
||
m |
(optional) true clears map l before it is filled. Default: false |
||
n |
(optional) Path and name of a file, into which to save the response data → See section HTTP Response Headers and Data for details. |
HTTP Request Headers
It is also possible to add request headers (with values) to a request by adding value pairs to the map specified in parameter l before the function execution. The following syntax has to be used.
REQUEST_HTTP_HEADER_<Value> |
Note: Please note that uppercase and lowercase in <Value> will be considered for the map key and subsequently also for the name of the actual HTTP request header.
Note: To make sure the values of the request (request headers) and the response (response headers) do not get mixed up, you can set parameter m to true, which will clear the map l before the HTTP response is stored in it.
Example:
We want to set the HTTP request header Max-Forwards (limits the number of times the message can be forwarded through proxies or gateways) to 10.
HTTP Response Headers and Data
The response of the HTTP request can be stored into a map l. This map then contains the following keys with the associated values.
Key |
Value |
RESPONSE_HTTP_STATUS |
Returned HTTP status. |
RESPONSE_HTTP_STATUSLINE |
Returned status line. |
RESPONSE_HTTP_DATA |
Returned data. Important note: If the value for RESPONSE_HTTP_DATA is not to be stored in a map but in a file, because it is a PDF document, for example, or similar (binary), the file must be specified in parameter n. |
RESPONSE_HTTP_HEADER_<...> |
HTTP response headers. For example RESPONSE_HTTP_HEADER_CONTENT-TYPE for HTTP response header Content-Type . |
In addition, the returned data (not the response headers) can be stored in a file n. The following is an overview of all possible combinations.
Used parameters |
Saved data |
Only map l |
The map contains the response headers and the returned data (as value of key RESPONSE_HTTP_DATA ). |
Only file n |
The file contains only the returned data (but no response headers). |
Map l and file n |
The map contains only the response headers (but not the key RESPONSE_HTTP_DATA ). The file contains only the returned data (but no response headers). |
Examples
Parameter a |
http://maps.googleapis.com/maps/api/geocode/xml |
http://www.lobster.de/img/150402_edm_data.jpg |
http://httpbin.org/post |
Parameter b |
|
|
|
Parameter c |
address=82343+Hindenburgstra%C3%9Fe+15 |
|
custname=Lobster&delivery=18:00 |
Parameter d |
|
|
|
Parameter e |
|
|
|
Parameter f |
|
|
application/x-www-form-urlencoded |
Parameter g |
GET |
GET |
POST |
Parameter h |
|
|
|
Parameter i |
|
|
|
Parameter j |
|
180 |
|
Parameter k |
|
|
2 |
Parameter l |
map_Result_1 |
map_Result_2 |
map_Result_3 |
Parameter m |
true |
true |
true |
Parameter n |
|
./temp/http/picture/logo.jpg |
|
Result |
200 |
200 |
200 |
'RESPONSE_HTTP_HEADER_ACCEPT-RANGES'='none'
'RESPONSE_HTTP_HEADER_CONTENT-TYPE'='application/xml; charset=UTF-8'
'RESPONSE_HTTP_HEADER_TRANSFER-ENCODING'='chunked'
'RESPONSE_HTTP_HEADER_X-XSS-PROTECTION'='1; mode=block'
'RESPONSE_HTTP_HEADER_SERVER'='mafe'
'RESPONSE_HTTP_HEADER_ALTERNATE-PROTOCOL'='80:quic,p=0'
'RESPONSE_HTTP_HEADER_ACCESS-CONTROL-ALLOW-ORIGIN'='*'
'RESPONSE_HTTP_HEADER_VARY'='Accept-Language,Accept-Encoding'
'RESPONSE_HTTP_STATUS'='200'
'RESPONSE_HTTP_DATA'='<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
<status>OK</status>
<result>
<type>street_address</type>
<formatted_address>1600 Amphitheatre Parkway, Mountain View, CA 94043, USA</formatted_address>
<address_component>
<long_name>1600</long_name>
<short_name>1600</short_name>
<type>street_number</type>
</address_component>
.
.
.
<geometry>
<location>
<lat>37.4224553</lat>
<lng>-122.0843062</lng>
</location>
<location_type>ROOFTOP</location_type>
<viewport>
<southwest>
<lat>37.4211063</lat>
<lng>-122.0856552</lng>
</southwest>
<northeast>
<lat>37.4238043</lat>
<lng>-122.0829572</lng>
</northeast>
</viewport>
</geometry>
<place_id>ChIJ2eUgeAK6j4ARbn5u_wAGqWA</place_id>
</result>
</GeocodeResponse>
'
'RESPONSE_HTTP_HEADER_X-FRAME-OPTIONS'='SAMEORIGIN'
'RESPONSE_HTTP_STATUSLINE'='OK'
'RESPONSE_HTTP_HEADER_EXPIRES'='Thu, 28 May 2015 06:58:53 GMT'
'RESPONSE_HTTP_HEADER_DATE'='Wed, 27 May 2015 06:58:53 GMT'
'RESPONSE_HTTP_HEADER_CACHE-CONTROL'='public, max-age=86400'
'RESPONSE_HTTP_HEADER_CONTENT-TYPE'='image/jpeg'
'RESPONSE_HTTP_HEADER_ACCEPT-RANGES'='bytes'
'RESPONSE_HTTP_HEADER_VARY'='Accept-Encoding'
'RESPONSE_HTTP_HEADER_SERVER'='Apache'
'RESPONSE_HTTP_HEADER_LAST-MODIFIED'='Thu, 02 Apr 2015 08:04:18 GMT'
'RESPONSE_HTTP_STATUS'='200'
'RESPONSE_HTTP_HEADER_KEEP-ALIVE'='timeout=15, max=100'
'RESPONSE_HTTP_STATUSLINE'='OK'
'RESPONSE_HTTP_HEADER_ETAG'='"1b53-512b9474c8480"'
'RESPONSE_HTTP_HEADER_DATE'='Wed, 27 May 2015 07:38:18 GMT'
'RESPONSE_HTTP_HEADER_CONNECTION'='Keep-Alive'
'RESPONSE_HTTP_HEADER_CONTENT-LENGTH'='6995'
'RESPONSE_HTTP_HEADER_CONTENT-TYPE'='application/json'
'RESPONSE_HTTP_HEADER_ACCESS-CONTROL-ALLOW-CREDENTIALS'='true'
'RESPONSE_HTTP_HEADER_SERVER'='nginx'
'RESPONSE_HTTP_STATUS'='200'
'RESPONSE_HTTP_DATA'='{
"args": {
"custname": "Lobster",
"delivery": "18:00"
},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept-Encoding": "gzip,deflate",
"Cache-Control": "no-cache",
"Content-Length": "0",
"Content-Type": "application/x-www-form-urlencoded; charset=ISO-8859-1",
"Host": "httpbin.org",
"User-Agent": "Lobster_data"
},
"json": null,
"url": "http://httpbin.org/post?custname=Losbter&delivery=18:00"
}
'
'RESPONSE_HTTP_STATUSLINE'='OK'
'RESPONSE_HTTP_HEADER_ACCESS-CONTROL-ALLOW-ORIGIN'='*'
'RESPONSE_HTTP_HEADER_DATE'='Wed, 27 May 2015 07:50:30 GMT'
'RESPONSE_HTTP_HEADER_CONNECTION'='keep-alive'
'RESPONSE_HTTP_HEADER_CONTENT-LENGTH'='500'