Skip to main content

Process request

Sends a single request to a specified address and receives a response using the default settings

Function ProcessRequest(Val Address, Val Data = "", Val ResponseString = True, Val Tls = "", Val Proxy = "") Export

ParameterCLI optionTypeRequiredDescription
Address--addressStringAddress and port
Data--dataString, BinaryDataData or text to be sent
ResponseString--stringBooleanAn attribute of receiving the response as a string
Tls--tlsStructure Of KeyAndValueTLS settings, if necessary. See GetTlsSettings
Proxy--proxyStructure Of KeyAndValueProxy settings, if required. See GetProxySettings
Returns

BinaryData, String - Response or error information

tip

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
Address = "45.79.112.203:4242";
Data = "Echo this!" + Chars.LF;

Result = OPI_TCP.ProcessRequest(Address, Data);

Address = "tcpbin.com:4243";

ProxtUser = "proxyuser";
ProxyPassword = "12we...";
ProxyAddress = "127.0.0.1";
ProxyPort = "1080";

Proxy = OPI_TCP.GetProxySettings(ProxyAddress, ProxyPort, "socks5", ProxtUser, ProxyPassword);
Tls = OPI_TCP.GetTLSSettings(True);

Result = OPI_TCP.ProcessRequest(Address, Data, , Tls, Proxy);
# JSON data can also be passed as a path to a .json file

oint tcp ProcessRequest \
--address "tcpbin.com:4243" \
--data "Echo this!\n" \
--tls "{'use_tls':true,'accept_invalid_certs':true}" \
--proxy "{'server':'127.0.0.1','port':'1080','proxy_type':'socks5','login':'proxyuser','password':'***'}"
Result
"Echo this!\n"