1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-04 20:54:02 +02:00
Files
OpenIntegrations/docs/en/md/HTTP/Request-processing/Send-part.mdx
T

81 lines
2.2 KiB
Plaintext
Vendored

---
sidebar_position: 4
description: Send part and other functions to work with HTTP 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, HTTP]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Send part
Sends a request with the specified part of the body and the Content-Range header
`Function SendPart(Val StartPosition, Val ByteCount, Val Method = "PUT") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| StartPosition | - | Number | ✔ | Start position in request body |
| ByteCount | - | Number | ✔ | Number of bytes from the specified start position for sending |
| Method | - | String | ✖ | Request HTTP method |
Returns: DataProcessorObject.OPI_HTTPClient - This processor object
:::caution
**NOCLI:** this method is not available in CLI version
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
URL = "https://bin.openintegrations.dev";
URL = URL + "/put";
ChunkSize = 524288;
Data = GetBinaryDataFromString("Some data for sending");
// Sending only "data for"
StartPosition = 5;
Bytes = 8;
Result = OPI_HTTPRequests.NewRequest()
.Initialize(URL)
.SetBinaryBody(Data)
.SendPart(StartPosition, Bytes) // <---
.ReturnResponseAsJSONObject();
```
```json title="Result"
{
"args": {},
"data": "data for",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Accept-Charset": "utf-8",
"Accept-Encoding": "gzip",
"Connection": "Keep-Alive",
"Content-Length": "8",
"Content-Range": "bytes 5-12/21",
"Content-Type": "application/octet-stream",
"Host": "bin.openintegrations.dev",
"Max-Forwards": "10",
"User-Agent": "1Script v$2.0.0.0",
"X-Arr-Log-Id": "783e6c64-07b5-47b6-bf4b-6eb81e6b879b",
"X-Arr-Ssl": "2048|256|C=BE, O=GlobalSign nv-sa, CN=GlobalSign GCC R6 AlphaSSL CA 2025|CN=*.openintegrations.dev",
"X-Forwarded-Host": "bin.openintegrations.dev",
"X-Original-Url": "***"
},
"json": null,
"origin": "***",
"url": "https://bin.openintegrations.dev/put"
}
```