REST Head

Reference documentation for using the REST API REST Head action

Written By Support Channel

Last updated 8 months ago

Overview of the REST Head action

The REST Head action allows a workflow to send a HTTP HEAD request to a RESTful API endpoint. This is used to retrieve the response headers without downloading the full content of the resource.

Purpose

To retrieve metadata (such as content length, content type, or last modified time) from a resource at a given URL without downloading the body of the resource.

Parameters

Headers
1 URL

Output

Status, OK, Error, Client error, Server error, Accepted, No Content, Bad Request, Not Authorised, Not Acceptable, Not Found, Forbidden, Text, Body, Type, Char Set

Understanding the REST Head action

The REST Head action sends an HTTP HEAD request, which is similar to a REST Get request, except the server must not return a message body. Instead, it returns only the response headers that would have been included if the resource were fetched with a REST Get.

Headers

A list of header names and values for the API request. For example:

  • Content-Type: β€œapplication/json”

  • Authorisation: β€œrest_api_key=1234”

URL

Specify the endpoint where the HEAD request should be sent.

Working with the REST Head action

This action is ideal for checking metadata before deciding to download or process a resource. For example, you can inspect the Content-Length header to determine the size of a file before downloading it using a REST Get action.

⚠️ Caution

A response to a REST Head method should not contain a body. If it does, the body must be ignored. Any representation headers that might describe that body are instead assumed to describe what a REST Get request to the same URL would return.

Output Variables

Output

Code

Type

Description

Status

β€”

Text

Shows the HTTP Status Code of request.

OK

200

Boolean

The request was successful, and the response contains the expected data.

Accepted

202

Boolean

The request was accepted for processing, but the processing has not been completed.

No Content

204

Boolean

The request was successful, but there is no content in the response.

Bad Request

400

Boolean

The server could not understand the request due to invalid syntax or parameters.

Not Authorised

401

Boolean

The request was denied due to invalid or missing authentication credentials.

Forbidden

403

Boolean

The request is valid, but the server is refusing to fulfil it.

Not Found

404

Boolean

The resource requested could not be found on the server.

Not Acceptable

406

Boolean

The requested format is not supported by the server.

Client Error

4xx

Boolean

Any status in the 400–499 range indicating a client-side error.

Server Error

5xx

Boolean

Any status in the 500–599 range indicating a server-side error.

Error

β€”

Text

A general error occurred, such as connection failure or timeout.

Text

β€”

Text

Plain text of the body of the the request

Body

β€”

Text

Data received in response to request sent

Type

β€”

Text

Media type of the response body. For example application/json

Char Set

β€”

Text

The character encoding used in the response. For example UTF-8

Create and manage REST Head actions

Add a REST Head action

Add the action

Use the following steps to add the action to your workflow.

Configure the action

Use the following steps to configure the action.

  1. Click Add Header to create a new header entry. This reveals the Header popup.

  2. Select Header and type the name of the header.

  3. Select Value and input the value of the header

  4. Click OK to complete setup of your new field value.

  5. Repeat the above steps for any addition additional headers needed.

  6. Set a value for the URL.

  7. Click back in the main view to hide the slide-over.

Edit the action

Use the following steps to make changes to the action.

  1. Edit an existing Header entry by clicking on it. This displays the Edit Header popup and allows you to make changes.

  2. Remove an unwanted entry by clicking the red cross toward its right-side.

  3. Click back in the main view to hide the slide-over.

Delete a REST Head action

Use the following steps to remove the action from your workflow:

Take care when deleting an action to also remove any logic using its outputs: workflow steps may function incorrectly or break if they attempt to evaluate an output of a deleted action.