Simple HTTP

Updated 8 months ago by Karan

In this step-by-step guide, you will understand how to configure a Simple HTTP call to your website or application. The core benefit of a simple HTTP node from Byteline is that you don't need to code anything to make an HTTP call, which can be used to make a call to a third-party system.

Let's get started.

Add Simple HTTP node

Step - 1: To create a flow design check the How to create your first flow design.

Step -2: To add a Simple HTTP node, click on the add button over the top-left corner of the node.

Step -3: A pop-up will launch reflecting the multiple nodes. Select the Simple HTTP node to add it to your flow.

Configure

Step -4: Now click on the edit button to start configuring the simple HTTP node.

Step - 5: Enter the API URL linked to your backend or third-party web service to access the data from the database via a simple HTTP(S) request.

Supported HTTP Methods

There are 4 methods to call the URL but in every method, the URL shall stay the same.

1. GET Method: This method is used for retrieving the data.

Note: Only header is allowed In GET method

2. POST Method: This method is used for sending the data when the call can perform some resource modification.

Note: You can configure both body and header in POST method

Only JavaScript Object Notation (JSON) or form-data for the POST call method is accepted in the body.

Enter the data in JSON like shown below:

Hit the save button after entering all the data.

In the form-data, data is entered in key-value pair as shown below:

After you enter the key-value data, hit the save button below.

3. PUT Method: This method is used to update the data entered in the database.

You can have JSON or form body even with the PUT method.

4. DELETE Method: This method is used to delete a record in the database.

Step -6: Configure headers

The configured HTTP API endpoint might require to pass specific headers. These can be configured using the Header tab. Headers are key-values pairs that can be specified using this tab.

Step -7: Successful configuration window will appear like this:

Once you save the configuration, the indicator over the top-right corner of the node will turn to green.

The green indicator shows that the simple HTTP node is successfully configured to your flow.

Your simple HTTP node has been configured successfully. Feel free to connect us for any doubt.

Pagination

Simple HTTP task also supports pagination method to easily fetch multiple pages from a GET call by using a simple dropdown. Below methods are supported for pagination. You should pick the method based on the pagination process supported by the API being called. This is usually pretty prominent in the API documentation.

None

This means the pagination is off.

Count-based Offset

This pagination method works by sending offset query param in the URL. This parameter specifies the starting index of the page to fetch. This query parameter is automatically added to the GET request by Byteline to retrieve all the records by sending multiple GET requests.

The response needs to have the following fields for this pagination to work correctly.

  • offset: This indicates the starting offset of the response data
  • count: The number of records in the response
  • total: The total number of records that are available

The following alternate names are supported for offset and total

  • offset: offset, start
  • total: total, totalResults
Cursor-based Offset

This pagination method also works by sending offset in the query params, but it's a text-based offset. This offset indicates to the host API the beginning of the next page. This query parameter is automatically added to the GET request by Byteline to retrieve all the records by sending multiple GET requests.

The response needs to have the following fields in the response body for this pagination to work correctly.

  • offset: This indicates the text-based offset that should be passed to get the next page.
  • has_more: Optional. If present, next page call is only made when its value is true

The following alternate names are supported for offset and has_more

  • offset: offset, after
  • has_more: has_more


How did we do?