Skip to main content
Skip table of contents

HTTP Request

Input

✳️ Any (JSON)

Ouptut

✳️ Any (JSON) (Passthrough)

(plus) Response Data (object) (Optional)

Summary

This action will make an HTTP request to the specified endpoint. The method, body, and content type are customizable.

This action also supports request batching – if an array of objects (a tabular dataset) is passed in, requests can be batched to work around request or rate limits.

The response is recorded onto the workflow pipeline and is available for the next action. The response also includes metadata information like status code and HTTP headers.

Error Handling

This action supports various error handling options:

  • Fail on Empty Body – If a response is expected from the endpoint, then this action can be set to fail if no body is received back.

  • Fail on 4xx – If the HTTP response status code is 400-499, then this action will fail.

  • Fail on 5xx – If the HTTP response status code is 500-599, then this action will fail.

Request Batching

Some remote API endpoints only accept a certain amount of objects at a certain time, or impose rate limits on the number of requests per minute.

Using request batching, you can take a large dataset and break it up into multiple smaller requests to upload the dataset over a period of time.

For example, if your dataset looked like this:

JSON
{
  "myData": [
    { "id": 83729, "name": "Alice Johnson" },
    { "id": 47381, "name": "Bob Smith" },
    { "id": 21984, "name": "Charlie Brown" },
    { "id": 59213, "name": "David White" },
    { "id": 14825, "name": "Eve Davis" },
    /* ... 1,000 additional records omitted ... */
    { "id": 63094, "name": "Frank Green" },
    { "id": 42975, "name": "Grace Miller" },
    { "id": 30058, "name": "Hannah Martin" },
    { "id": 97034, "name": "Ivy Thompson" },
    { "id": 25618, "name": "Jack Wilson" }
  ]
}

Which contains a total of 1,010 records. And you set the following options:

  • Batch Size: 100

  • Batch Delay: 60

Then the HTTP Request action would actually send 11 HTTP requests:

Request 1

JSON
[
  { "id": 83729, "name": "Alice Johnson" },
  { "id": 47381, "name": "Bob Smith" },
  { "id": 21984, "name": "Charlie Brown" },
  { "id": 59213, "name": "David White" },
  { "id": 14825, "name": "Eve Davis" },
  /* ... 95 additional records omitted ... */
]

Request 2-10

Omitted for brevity

Request 11

JSON
[
  /* ... 5 additional records omitted ... */
  { "id": 63094, "name": "Frank Green" },
  { "id": 42975, "name": "Grace Miller" },
  { "id": 30058, "name": "Hannah Martin" },
  { "id": 97034, "name": "Ivy Thompson" },
  { "id": 25618, "name": "Jack Wilson" }
]

Note that the final request will contain any remaining records, and may be less than the Batch Size if the records don’t divide evenly. In the previous example, 100 doesn’t divide evenly into 1,010, so the last request contains the final 10 records only.

Asynchronous Polling

If an endpoint supports the HTTP Asynchronous Request-Reply Pattern, you may check this box to enable polling.

When polling is enabled, the HTTP Request action will wait until the long-polling operation is completed before finishing the current action and resuming the workflow.

If the endpoint does not support polling (i.e. it does not return 202 Accepted nor a proper Location header), the HTTP action will fail.

Click here for a technical overview the asynchronous request-reply pattern on Microsoft Learn.

Verified Polling Compatibility

The following applications have been confirmed to be compatible with iWorkflow polling:

Response Types

If the response type is JSON, then the response will be incorporated directly into the workflow pipeline and available for expressions in future actions (i.e. you don’t need to parse the JSON first).

If the response type is not JSON, then the “body” property will be a string containing the response body (be it HTML or some other type of data).

Example JSON Response

JSON
{
  "myHttpResponse": {
    "url": "https://example.org/api/sample",
    "method": "GET",
    "statusCode": 200,
    "headers": { ... },
    "body": {
      "result": "OK",
      "error": null,
      "message": "Sample JSON Response"
    }
  }
}

Example non-JSON Response

JSON
{
  "myHttpResponse": {
    "url": "https://example.org/sample/page.html",
    "method": "GET",
    "statusCode": 200,
    "headers": { ... },
    "body": "<!DOCTYPE html>\n<html lang=\"en\"> <head> <title>..."
  }
}

Properties

Name

Type

Templatable

Notes

Method

Text

(tick)

Supply a valid HTTP method (verb) to use for the request, e.g. “GET”, “POST”, “PUT”, etc.

URL

Text

(tick)

Specify the remote URL, including any query string parameters. Part of all of this field may be templatable (i.e., you may supply a query string parameter dynamically).

Headers

List

(tick)

Optional. Specify the HTTP headers that should be included.

The header values are templatable to allow for dynamic values to be included.

Body

Text

(tick)

Optional. Specify the body to be included for methods that typically require a body (e.g. POST, PUT, PATCH).

Content Type

Text

(tick)

Specify a valid MIME type (e.g. application/json or text/csv) for the request.

Some remote endpoints won’t accept your request without a correct content type specified.

Batch Size

Number

(error)

Specify the size of each batch (i.e. the maximum number of records that should be sent in each request).

Batch Delay

Number

(error)

The number of seconds to wait between batched requests.

🅾️ Output Property

Text

(error)

Specify the name of the property to store the HTTP response data in.

The response structure is as follows, if your output property is set as “httpResponseData”:

CODE
"httpResponseData": {
  "url": "https://example.org/.../",
  "method": "GET",
  "statusCode": 200,
  "headers": {
    "Date": [
        "Mon, 24 Jun 2024 17:07:26 GMT"
    ],
    "Server": [
        "nginx"
    ],
    "Cache-Control": [
        "private"
    ],
    /* ... additional headers ... */
  }
  "body": { ... }
  /* Or, for non-JSON: "body": "..." */
}

Fail on Empty Body

Checkbox

(error)

If checked, and if there is no response body from the remote endpoint, this action will fail.

Fail on 4xx

Checkbox

(error)

If checked, and if the response status is 400-499, this action will fail.

Fail on 5xx

Checkbox

(error)

If checked, and if the response status is 500-599, this action will fail.

Enable Asynchronous Polling

Checkbox

(error)

If checked, enables asynchronous polling against the remote endpoint, which will cause this action to wait until the remote operation completes.

Polling Timeout

Number

(error)

Specify the maximum amount of time, in seconds, that the HTTP action should wait for a polling endpoint to complete.

Valid values are from 1 to 86400 (24 hours).

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.