HTTP Request
Activity | Http |
---|---|
Description | Execute HTTP requests |
Input :
PropertyName | Type | Required | Default Value | Description |
---|---|---|---|---|
uri | URL | YES | Target URI | |
method | STRING | NO | GET | Http method (GET/POST/PUT/DELETE) |
jsonContent | JSON | NO | Body of the request to send to the server (cannot be used with GET and DELETE method) Override contentFileToken if specified | |
contentFileToken | URL | NO | FileContent containing the body of the request to send to the server (cannot be used with GET and DELETE method) | |
timeout | INT | NO | 60 | HTTP Request Timeout in seconds |
failIfError | BOOL | NO | TRUE | Set the activity result as failed if the request return a failed status.
|
httpHeaders | DICTIONARY | NO | List of http headers | |
httpQueryParams | DICTIONARY | NO | List of query parameter | |
outputFileName | STRING | NO | Name of the file for the http response. If not specified, the file name will be retrieved from (in order)
| |
outputFileStoreName | STRING | NO | Name of the store where to save the http response | |
RequestContentType | STRING | NO | Expected MIME type of the request’s response https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types/Common_types |
Output
PropertyName | Type | Optional | Description |
---|---|---|---|
jsonContent | JSON | NO | HTTP Response if content-type is “application/json” |
contentFileToken | URL | NO | FileContent containing the body of the response (see outputFileName and outputFileStore input parameters) |
length | INT | NO | HTTP Response Length in bytes |
StatusCode | INT | NO | HTTP Response Status code ( https://developer.mozilla.org/fr/docs/Web/HTTP/Status ) |
reason | STRING | NO | The reason phrase which typically is sent by servers together with the status code. |
httpHeaders | DICTIONARY<STRING,STRING[]> | NO | Http headers of the response |
Example:
Download a file using HTTP
Input
{
"uri" : "https://sample.com/download/test.csv.gz",
"method" : "GET",
"outputFileStoreName" : "local",
"httpHeaders": {
"X-Custom-Header":"Sample value"
}
}
Output
{
"contentFileToken":"file://local/test.csv.gz",
"length": 45846468,
"statusCode": 200,
"httpHeaders": {
"Date": [
"Mon, 18 Jul 2022 10:09:14 GMT"
],
"Server": [
"gws"
],
"X-XSS-Protection": [
"0"
],
"X-Frame-Options": [
"SAMEORIGIN"
],
"Alt-Svc": [
"h3=\":443\"; ma=2592000",
"h3-29=\":443\"; ma=2592000",
"h3-Q050=\":443\"; ma=2592000",
"h3-Q046=\":443\"; ma=2592000",
"h3-Q043=\":443\"; ma=2592000",
"quic=\":443\"; ma=2592000"
]
}
}