Supports HTTP methods GET, POST, PUT, HEAD, DELETE with and without content. \ Supports sending asynchronous requests and requests with pending responses. +\ In case of an error, the transition is carried out along the “Error” branch, and the corresponding HTTP code is returned to the “Error code” variable. +\ The component supports sessions, storing and using cookies, as well as HTTPS and certificate verification.

Component Web request to direct URL

:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:

Description

Allows you to make HTTP and HTTPS requests to web services via an arbitrary URL. +\

The actual sending of the request can be made both from the server on which the current script processor is running, and from the edge servers of the “Incoplax” system.

In some cases it can be replaced by executing a "curl" request via the command line (component Start process).

Table 1. System characteristics

Index

120

Short name

web

Script types

All

Start module

r_script_component_web

Mode

Asynchronous

Icon

120

Branching type

Branching, closing

Properties

Table 2. Properties
Specification Description

Name: Proxy

Code: proxyMode

Visibility condition: no

Default: No

Toggle proxy server use.

Name: Proxy authentication

Code: proxyAuth

Visibility condition: yes Default: No

Proxy authentication switch.

Name: Proxy login

Code: proxyLogin

Visibility condition: yes

Default: — 

Login to the proxy server.

Name: Proxy password Code: proxyPass Visibility condition: yes

Default: — 

Password for the proxy server.

Name: Proxy address

Code: proxyAddr

Visibility condition: yes

Default: — 

Proxy server address.

Name: Proxy port

Code: proxyPort

Visibility condition: yes

Default: — 

Proxy server port.

Name: Max redirects

Code: maxRedirectCount

Visibility condition: no Default: — 

Limit on the maximum number of redirects. The value for the HTTP header is Max-Forwards.

Name: URL Code: url

Visibility condition: no

Default: — 

Request URL. Must contain a schematic (for example, http://).

Name: Request Source

Code: reqSrc

Visibility condition: no Default: — 

Server address from which to send the request.

Default request is sent from the server where the handler executes the script.

Possible indication formats:

  • NodeName

  • NodeName:Iface

  • NodeName@NodeAddr

  • NodeName@NodeAddr:Iface

  • RoleId

  • RoleId:Iface

  • RoleName

  • RoleName:Iface

where

  • NodeName – short name of the node in its full name (abc002@192.168.0.12);

  • NodeAddr – node address in its full name;

  • RoleId – role identifier in the configuration, the node is determined by the role;

  • RoleName – name of the role in the configuration, the node is determined by the role;

  • Iface – address of the network interface on the server.

If there is no node/role or any incorrect name setting, the sending is made from the server where the handler executes the script.

If the address of the network interface of the sender’s server is missing or incorrectly specified, the sending will occur from the address of the sender’s node.

Name: Method

Code: method

Visibility condition: no

Default: GET

Possible options:

  • POST (post, 0)

  • GET (get, 1)

  • PUT (put, 2)

  • HEAD (head, 3)

  • DELETE (delete, 4)

  • PATCH (patch, 5)

  • TRACE (trace, 6)

  • OPTIONS (options, 7)

Name: Content Type Code: contentType Visibility condition: yes

Default: "application/x-www-form-urlencoded"

Value for HTTP header Content-Type.

Name: Request body

Code: reqContentArg

Visibility condition: yes

Default: — 

Content of the HTTP request body.

Name: Request encoding

Code: reqEncoding

Visibility condition: yes

Default: utf-8

Encoding used to convert the request body from a string representation to a binary form before sending.

Possible options:

  • unicode (0)

  • utf-8 (1)

  • utf-7 (2)

  • cp1251 (3) – Code page windows-1251 (Cyrillic)

  • Specify name (byname, 4) – Specify the name of the encoding manually.

Name: Name of the request encoding

Code: reqEncodingName

Visibility condition: yes

Default: "cp1251"

Manually specified encoding name for the request body.

Name: Basic Authentication Code: basicAuth Visibility condition: no

Default: No

Basic authentication switch.

Name: Login

Code: bAuthLogin

Visibility condition: yes

Default: — 

Login for basic authentication.

Name: Password

Code: bAuthPass

Visibility condition: yes

Default: — 

Password for basic authentication.

Name: Headings

Code: addHeaders

Visibility condition: no Default: — 

Additional HTTP headers inserted into the request. The argument contains a multi-line value, the format of each line is: HeaderName: HeaderValue.

Name: Cookie

Code: addCookies

Visibility condition: no

Default: — 

Additional COOKIES to be inserted into the request. The argument contains a multi-line value, the format of each line is: Key=Value.

Name: Mode Code: mode Visibility condition: no

Default: Waiting for result

Component operating mode after sending a request.

Possible options:

  • Waiting for result (0) – Waiting for a response until the script completes.

  • Asynchronous launch (1) – Control is immediately transferred to the next component.

  • Timeout break (2) – Waits for a response for a set time, after which the HTTP connection is terminated and control is transferred to the next component.

  • Exit by timeout (3) – Waits for a response for a set time, after which control is transferred to the next component without breaking the connection and interrupting the sending process.

Name: Time, s

Code: timeoutSec

Visibility condition: yes

Default: — 

Timeout waiting for a response to a sent HTTP request.

Name: Response code

Code: respCodeVariable

Visibility condition: yes

Default: — 

Variable for storing the HTTP response code.

Not filled in if the request is not answered.

If the request ends with a 3xx response, then a new forwarded request is initiated and the 3xx response code is subsequently overwritten.

Name: Response headers

Code: respHeadVariable

Visibility condition: yes

Default: — 

Variable for storing HTTP response headers.

Not filled in if the request is not answered.

If the request ends with a 3xx response, then a new forwarded request is initiated and the headers are subsequently rewritten.

Name: Reply

Code: respVariable

Visibility condition: yes

Default: — 

Variable for storing the HTTP response body.

Not filled in if the request is not answered.

If the request ends with a 3xx response, then a new forwarded request is initiated and the body is subsequently overwritten.

Name: Response encoding

Code: respEncoding

Visibility condition: yes

Default: utf-8

The encoding in which the body of the HTTP response is located. Used to convert to a string representation in a script variable.

Possible options:

  • Auto from title (autoheader, 5)

  • Car from body (autometaheader, 6)

  • unicode (0)

  • utf-8 (1)

  • utf-7 (2)

  • cp1251 (3) – Code page windows-1251 (Cyrillic)

  • Specify name (byname, 4) – Specify the name of the encoding manually.

Name: Name of the response encoding

Code: respEncodingName

Visibility condition: yes Default: "cp1251"

Manually specified encoding name for the response body.

Name: Error

Code: errorVariable

Visibility condition: no

Default: — 

Variable for storing the HTTP error code along with a phrase, for example '404 Not Found'.

Name: Transition Code: transfer Visibility condition: no

Default: — 

The component to which control is transferred if the asynchronous sending operation completes successfully, or an HTTP response is received.

Name: Transition, time

Code: transferTimeout

Visibility condition: yes

Default: — 

The component to which control is transferred in the event of a timeout waiting for a response.

Name: Transition, error

Code: transferError

Visibility condition: no

Default: — 

The component to which control is transferred in the event of an error sending a request or receiving an unsuccessful response (codes 4xx – 6xx).

See also