nyno-http-post

nyno-http-post — Perform an HTTP POST request in a workflow


Description

- step: nyno-http-post
  args:
    - 'https://nyno.dev/test-post'
    - { name: "Alice" }
    - { "X-Custom-Header": "MyValue" }

The nyno-http-post step sends an HTTP POST request to the specified URL with an optional JSON body and optional headers. The response is stored in the workflow context (${prev} by default or a custom key via set_context).

Usage in a workflow YAML:

workflow:
  - step: nyno-http-post
    args:
      - 'https://nyno.dev/test-post'
      - { name: "Alice" }
      - { "X-Custom-Header": "MyValue" }

Parameters

Parameter Type Description
url string The URL to send the POST request to. Must include protocol (http:// or https://).
body object Optional JSON-serializable body to include in the POST request.
headers object Optional headers to include in the request. Defaults to { "Content-Type": "application/json" }.

Return Values

{
  "HTTP_RESPONSE": "...response body as string...",
  "HTTP_STATUS": 200,
  "HTTP_ERROR": null
}
{
  "HTTP_RESPONSE": "...",
  "HTTP_STATUS": 404,
  "HTTP_ERROR": "HTTP error 404"
}

Behavior


Examples

Example #1 — Basic POST request

workflow:
  - step: nyno-http-post
    args:
      - 'https://api.example.com/data'
      - { name: "Alice" }

Stores the response in ${prev}:

{
  "HTTP_RESPONSE": "...",
  "HTTP_STATUS": 200,
  "HTTP_ERROR": null
}

Example #2 — Custom headers

workflow:
  - step: nyno-http-post
    args:
      - 'https://api.example.com/data'
      - { name: "Alice" }
      - { "X-Custom-Header": "MyValue" }

Example #3 — Custom context key

workflow:
  - step: nyno-http-post
    args:
      - 'https://api.example.com/data'
      - { action: "send" }
    context:
      set_context: api_response

Stores the response under ${api_response}.


Notes


See Also