Web Request Builder

Enables you to perform web request to a specified Web API.

The Web Request Builder window is a powerful tool that allows you to create and customize web requests to interact with APIs. It consists of several sections that provide flexibility in configuring your requests. The Web Request Builder Window contains the following sections:

  • End Point - The "End Point" section is where you specify the URL to which your request will be made. The URL defines the API endpoint, which is the specific location where the API can access the required resources to perform a task..

  • Request Method - The request method that is used when calling the specified API.

  • Settings - The section where additional information are entered to be send with the web request.

  • Response - This section displays the response of the web request from the server.

Setting the Request Url

For sending a specific request, you have to specify the Url that defines the API endpoint in the EndPoint field. All the API operations are associated with the given endpoint, which is a place from where these APIs can access the resources that are required to perform a specific task.

Selecting the Request Methods

After the Url is specified, the request method that is to used for calling the specified API is to be selected. The available methods are :-

  • Get - This HTTP method is used to retrieve data from an API.

  • Post - To send the new data to an API, we can use this method.

  • Put - This method is used to update the existing data.

  • Delete - This is used to remove or delete the existing data.

  • Copy

  • Head

  • Options

The Parameter section

The parameter section contains 2 functionalities. They are:-

  • Add parameter - Adds a new line in the Parameters table mainly for the Get or Post request methods.

  • Delete parameter - Deletes the selected parameters from the table.

Authorization

Authorization of requests includes authenticating the identity of the client who sends the request and then verifying whether the client is allowed to access and perform the specified endpoint operations. The APIs basically use the authorization details to ensure that the client requests access data safely. The authorization types available are:-

  • None - If this is selected, the request builder won't send any auth data with the request.

  • Basic Auth - This allows users to send username and password along with the request for API login.

  • OAuth 1.0 - This allows users to access third-party API data. The OAuth 1.0 contains the following inputs:-

    • Consumer Key - Specifies the consumer key that is to be used if the API request is based on the OAuth1 authentication protocol.

    • Consumer Secret - Specifies the consumer secret that is to be used if the API request is based on the OAuth1 authentication protocol.

    • Access Token - Specifies the access token that is to be used if the API request is based on the OAuth1 authentication protocol, after the authorization request from the consumer has been approved.

    • Token Secret - Specifies the token secret that is to be used if the API request is based on the OAuth1 authentication protocol, after the authorization request from the consumer has been approved.

  • OAuth 2.0 - Specifies the access token to be used if the API to which the request is made is based on the OAuth2 authentication protocol. This token is usually generated as the response of another HTTP request to the specified API.

Body Section

This section is mainly used with the POST request when we require additional information to be sent to the server inside the body of the request for making some changes in the server like updation, insertion etc. For example, a login page to a website where you need to send some personal information like user credentials to the server to use the site. By default, the Body setting is set to None.

In the above screenshot, we get a response as Authentication Failed as the request and server parameters are not found matched to get a response. So, we are required to add the information with the correct format within the request body.

If we send the request with the proper data input in the Body tab by selecting the raw option and setting the format type to text or JSON as per your input your request will be properly authorized and a success message will be displayed in the Response section. In the Web Request Builder, you have the flexibility to include variables in the body section of your web request. Variables allow you to dynamically insert values into the request body, making your requests more dynamic and adaptable.

To specify a variable in the body section, you need to follow a specific format. The variable should be enclosed within ${} brackets, and you should provide the name of the variable inside. For example, if you have a variable named "VariableName," you can include it in the body section as ${VariableName}. Using variables in the body section can be particularly useful when you need to send dynamic data or include values that are generated during runtime.

The different options available for sending data are:-

  • none

  • form-data - Sends a form's data ie; sending information like filling out a form as these data are entered in key-value pairs. Here, the key is the name of the entry, and the value is the value of the entry you are sending.

  • x-www-form-urlencoded - It's similar to form-data and the only difference between them is that, when you sent the data via x-www-form-urlencoded, the url is encoded. Encoded indicates that the transmitted data is converted to various characters so that only authorized persons can recognize the data.

  • raw - The body data will be presented in the form of a stream of bits.

  • binary - The binary is used to send the data in a different format such as a file, image, etc. To use this option, select binary and then click on the Select File button to browse any file from your system.

  • GarphQL - Using this option, we can send the GraphQL queries in your requests by selecting the GraphQL tab in the request Body.

Response Section The "Response" section displays the response received from the server after making the web request. Here, you can view the outcome of your request, including success messages or error responses.

Last updated