HTTP Request

This action lets you make an HTTP request to your server. You can use one of the supported HTTP methods to make requests to the relevant server.

How it works

To make an HTTP request, add the HTTP Request action to your canvas and configure it as follows:

Select HTTP method : Select the HTTP method according to the action you want to perform on the resource identified. Available methods are GET, POST, PUT, and DELETE. By default, the value for this field is set to GET.

URL (Mandatory):
Enter the URL to which you want to make the HTTP request.

The next block lets you add Headers, Parameters, and Basic Auth. To do this, click on the + icon given beside respective field names.

URL Params (Optional):
Enter the URL parameter details.

Key (Mandatory):
Enter any parameters that you want to send to the server along with the URL.

Value (Mandatory):
Enter the value for the specified parameter.

You can send values for multiple URL parameters by clicking on the + link.

Basic Auth (Optional):
Enter the basic authentication details.

Username:
Enter the username.

Password:
Enter the password for the specified username.

Headers (Optional):
Enter any additional information that you want to send to the server along with the URL.

Key:
Enter the name of the key for which you want to send a value.

Value (Mandatory):
Enter the value for the specified key.

You can send values for multiple headers by clicking on the + link.

Timeout (Optional):
Enter the number of seconds for which you want to wait for the server to send response headers.

Decode GZIP Response (Mandatory):
Specify if you want to decode the GZIP response. Available options are True and False. By default, the value for this field is set to False.

Response Encoding (Mandatory):
Select the encoding type that you want to apply on the file. Available options are UTF-8, buffer, binary, hex, ASCII, and base64.

Reject Unauthorized (Mandatory):
Specify if you want to allow/disallow the URLs with invalid certificates. By default, the value for this field is set to True.

Follow Redirect (Mandatory):
Specify if you want to follow the HTTP 3xx responses for the specified URL. By default, the value for this field is set to True.

Follow All Redirects (Mandatory):
Specify if you want to follow all HTTP 3xx responses to multiple sites for the specified URL.

Once you have entered the details, click on Next, test the action and click DONE. Then, run the workflow. This will make the HTTP request to the specified URL.

Example

Let's understand it with the help of an example. Let's say you want to create a new employee record in your CRM application. To achieve this, follow the steps given below:

Step 1: Add HTTP Request action to canvas

Locate the HTTP Request action in the Connectors panel, and drag-and-drop it on the canvas. It will automatically get connected to the Start icon.  To configure the HTTP Request action, double-click the action icon. You will see the following screen. 

1-config-action.png



Click Next to continue.

Step 2: Set up HTTP Post request

You will be redirected to the HTTP Request action configuration window. Configure it as given below:

Select HTTP Post Method: Since we want to create a new record, select the POST method from the drop-down list. Similarly, you can select GET to retrieve a specific record, PUT to update a record, DELETE to delete a record, PATCH to modify an existing resource of the record, OPTIONS  to request information about the communication options available for the record, and HEAD to get the metadata of a specific record.

URL: Enter the complete URL of the CRM application domain along with protocol where you want to post the data. For example, https://myemployeerecords.com

URL Params: If you want to pass any additional information as parameters, click on the + button given below the URL Params label.

Basic Auth: If the URL you are performing operation on is secured using an authentication method, you will need to send the basic authentication details along with the request.  To send the basic authentication details, click on the + button given below the Basic Auth label.

2-authentication.png

Headers: Send any additional headers required to execute your request in the headers. To add headers, click on the + button given below the Headers label.

Set Body Type: Set the body type as x-www-form-urlencoded.

Body: Enter the details you want to send in form of key-value pairs for the POST request. To do so, click on the + button given below the Body label and add relevant key-value pairs in the input fields that appear. For the purpose of this example, we will add Employee ID and Employee Name.

Timeout: Enter the time in seconds after which the request should time out. 

3-data.png

Once you have entered the details, click Next, optionally test the action, and save the workflow.

Now when you execute this workflow, a new record will be created on the specified URL.