Perform a basic HTTP/S request.
An example workflow of using the container in a workflow on Direktiv.
id: request
functions:
- id: myrequest
image: vorteil/request
description: "send a get request"
states:
- id: hello
type: action
action:
function: myrequest
input: '{
"method": "GET",
"host" : "https://jsonplaceholder.typicode.com/posts"
}'
Providing debug to the json struct will print everything during the process it runs.
{
"method": "GET",
"url" : "https://vorteil.io",
"body" : {
"hello": "world"
},
"headers": {
"Content-Type": "application/json"
}
}
NOTE: The body and header fields are optional.
If the request is successful, the response will be wrapped inside of a JSON object, within the return field.
In the event that the response body is not in JSON format, the data will be base64 encoded and stored as the value of the return field.
{
"return": {
...
}
}
In the case that an error is encountered, it will present in the following format:
{
"errorCode": "com.request.error",
"errorMsg": "Something went wrong"
}
Content type
Image
Digest
Size
2.2 MB
Last updated
over 5 years ago
docker pull jkizo/request