HTTP Request
In this section, we will guide you on how to use the HTTP Request block.
Use Cases
HTTP Requests play a critical role in RPA (Robotic Process Automation). They allow bots to interact with various web services and APIs, enabling automation tasks.
Here are some common use cases:
- Fetching Data: Retrieve data from third-party APIs.
- Sending Data: Collect data from a webpage and push it to a server via API.
- System Integration: Integrate with your business systems for tasks like creating orders, approvals, sending notifications, and more.
- Many more fun use cases await your discovery!
What is an HTTP Request?
An HTTP request is a way for a client (e.g., browser, RPA bot) to request resources (such as webpages or data) from a server. It includes the request method (GET, POST, PUT, DELETE, etc.), headers, body, and other parts.
Request Methods
You can use common methods like GET, POST, PUT, DELETE, etc.
Request URL
You must provide a request URL. For testing purposes, you can use a temporary URL from Webhook.site.
https://webhook.site/73c6339b-84ae-43da-91e7-2db021641f6a
Request Headers
You can set request headers according to the API requirements. Headers come in key-value pairs and follow this format:
key: value
key: value
Each key-value pair is separated by :space
and written on a new line.
You can also use dynamic data here, such as passing in a token
:
Authorization: Bearer {{@vars.token}}
Query Parameters
Query parameters are configured similarly to headers.
The final query parameters will be appended to the request URL, like this:
https://example.com/api/?keyword=hello&version=v1
Request Body
The actual content of the request. It supports various common formats, such as application/json
, multipart/form-data
, application/x-www-form-urlencoded
, etc., depending on your needs.
Response
If you need to access the response data, assign it to a variable.
For example, if the response contains the following JSON data:
{
"Name": "Anna",
"Age": 18
}
To access the Name
field, you can do the following:
{{@vars.Res.body.Name}}
Example
Let’s try making a request to Webhook.site.
Below is what the request looks like when received at Webhook.site.
That's a complete example of making a request—simple, right?