HUB
Sign inSign up

direktiv/request

By direktiv

•Updated almost 5 years ago

Image
0

10K+

direktiv/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
  type: reusable
  image: direktiv/request:v1
description: "send a get request"
states:
- id: hello
  type: action
  action:
    function: myrequest
    input:
      method: "GET"
      url: "https://jsonplaceholder.typicode.com/posts"

⁠Input

input:
  method: "GET"
  url: "https://direktiv.io"
  body:
    hello: "world"
  headers:
    "Content-Type": "application/json"
  params:
    Hello: "world"
  username: "test"
  password: "test2"
  insecureSkipVerify": false

NOTE: The method and url fields are mandatory.

⁠Output

Output for a request that returns JSON.

{
    "return": {
        "body": {
            "hello": "world"
        },
        "headers":{
            "Age": 0
        },
        "status-code": 200,
        "status": "200 OK"
    }
}

Output for a request that isn't JSON.

{
    "return": {
        "data": "PGh0bWw+PGJvZHk+SGVsbG8gV29ybGQhPC9ib2R5PjwvaHRtbA==",
        "headers":{
            "Age": 0
        },
        "status-code": 200,
        "status": "200 OK"
    }
}

⁠Error

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

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

NOTE: %s indicating where in the container logic the request failed.

Tag summary

Content type

Image

Digest

Size

2.3 MB

Last updated

about 5 years ago

docker pull direktiv/request