You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-27 22:18:36 +02:00
85 lines
2.6 KiB
Plaintext
Vendored
85 lines
2.6 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 7
|
|
description: Process request and other functions to work with TCP in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
|
|
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, TCP]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# 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`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Address | --address | String | ✔ | Address and port |
|
|
| Data | --data | String, BinaryData | ✖ | Data or text to be sent |
|
|
| ResponseString | --string | Boolean | ✖ | An attribute of receiving the response as a string |
|
|
| Tls | --tls | Structure Of KeyAndValue | ✖ | TLS settings, if necessary. See GetTlsSettings |
|
|
| Proxy | --proxy | Structure Of KeyAndValue | ✖ | Proxy settings, if required. See GetProxySettings |
|
|
|
|
|
|
Returns: BinaryData, String - Response or error information
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Parameters with Binary data type can also accept file paths on disk and URLs
|
|
:::
|
|
<br/>
|
|
|
|
|
|
```bsl title="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);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
# 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}"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
:: 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}"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
"Echo this!\n"
|
|
```
|