Sign inSign up

jkizo/request

By jkizo

Updated almost 5 years ago

Image
0

953

jkizo/request repository overview

Request

Perform a basic HTTP/S request.

Direktiv

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"
    }'

Input

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.

Output

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": {
        ...
    }
}

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.request.error",
    "errorMsg": "Something went wrong"
}

Tag summary

Content type

Image

Digest

Size

2.2 MB

Last updated

over 5 years ago

docker pull jkizo/request