ym88659208ym87991671
HTTP request block | Documentation for developers

HTTP request block

Last updated on April 10, 2024

English version of the documentation is under development.

This block is used to interact with external resources via HTTP requests and save responses to variables. The block offers two transitions: for successful and unsuccessful requests.

You can use the block to make requests with the following HTTP methods:

  • GET;
  • PUT;
  • POST;
  • DELETE.

The request address can contain variables. Variables in the address must be specified in curly braces:

https://example/services/api?var=${variable}

All curly braces in the address that do not refer to variables must be replaced by the %7B and %7D character set for the left and the right bracket respectively.

The body (Body tab) and headers (Headers tab) of the request can also contain variables.

Example of a variable in the request body:

{
"age": $age,
"name": "$Name"
}

Example of a variable in the request header:

Authorization: Token $Password

The body of the request can contain data in any format: JSON, XML, or arbitrary text.

The response of the external service represented in the XML format or as a valid JSON object is automatically converted into a JavaScript object. The response is saved to the $httpResponse system variable. Fields of responses that can be accessed using the dot:

$httpResponse.fieldName

Responses submitted in other formats are saved in $httpResponse as a raw string.

The response code is saved to the $httpStatus system variable.

Sber process cookies only to personalize services according to Cookies Usage Policy. You can prevent the processing of cookies in your browser settings.