1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-29 22:27:42 +02:00
Files
OpenIntegrations/docs/en/md/TCP/Client-methods/Process-request.mdx

73 lines
2.1 KiB
Plaintext
Raw Normal View History

2024-12-15 21:26:24 +03:00
---
2024-12-16 15:44:01 +03:00
sidebar_position: 7
2025-05-05 11:15:20 +03:00
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
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, TCP]
2024-12-15 21:26:24 +03:00
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-12-25 09:53:47 +03:00
# Process request
2024-12-15 21:26:24 +03:00
Sends a single request to a specified address and receives a response using the default settings
2025-03-22 11:54:15 +03:00
`Function ProcessRequest(Val Address, Val Data = "", Val ResponseString = True, Val Tls = "") Export`
2024-12-15 21:26:24 +03:00
| 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 |
2025-03-22 11:54:15 +03:00
| Tls | --tls | Structure Of KeyAndValue | ✖ | TLS settings, if necessary. See GetTlsSettings |
2024-12-15 21:26:24 +03:00
2025-03-24 15:47:37 +03:00
Returns: BinaryData, String - Response or error information
2024-12-15 21:26:24 +03:00
<br/>
:::tip
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
2025-06-29 14:35:33 +03:00
Address = "45.79.112.203:4242";
2025-09-07 15:42:18 +03:00
Data = "Echo this!" + Chars.LF;
2024-12-15 21:26:24 +03:00
2024-12-16 15:44:01 +03:00
Result = OPI_TCP.ProcessRequest(Address, Data);
2025-09-01 14:51:24 +03:00
Address = "tcpbin.com:4243";
Tls = OPI_TCP.GetTLSSettings(True);
Result = OPI_TCP.ProcessRequest(Address, Data, , Tls);
2024-12-15 21:26:24 +03:00
```
2024-12-18 14:34:57 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint tcp ProcessRequest \
2025-07-05 10:54:51 +03:00
--address "tcpbin.com:4243" \
--data "Echo this!\n" \
2025-09-16 09:07:33 +03:00
--tls "{'use_tls':true,'accept_invalid_certs':true}"
2024-12-18 14:34:57 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint tcp ProcessRequest ^
2025-07-05 10:54:51 +03:00
--address "tcpbin.com:4243" ^
--data "Echo this!\n" ^
2025-09-16 09:07:33 +03:00
--tls "{'use_tls':true,'accept_invalid_certs':true}"
2024-12-18 14:34:57 +03:00
```
</TabItem>
</Tabs>
```json title="Result"
"Echo this!\n"
```