You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-16 09:38:28 +02:00
101 lines
2.9 KiB
Plaintext
Vendored
101 lines
2.9 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 4
|
|
sidebar_class_name: doc-no-cli
|
|
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';
|
|
import Admonition from '@theme/Admonition';
|
|
|
|
# Send part
|
|
Sends a request with the specified part of the body and the Content-Range header
|
|
|
|
|
|
|
|
<Tabs>
|
|
<TabItem value="params" label="Parameters" default>
|
|
|
|
`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 |
|
|
|
|
|
|
<div className="return-value-note">
|
|
<div className="return-value-note__title">Returns</div>
|
|
<div className="return-value-note__value">
|
|
DataProcessorObject.OPI_HTTPClient - This processor object
|
|
</div>
|
|
</div>
|
|
|
|
</TabItem>
|
|
<TabItem value="extended" label={<span>Advanced call{' '}<a href="/docs/Start/Advanced-call" target="_blank" rel="noreferrer" title="About advanced call" onClick={(e) => e.stopPropagation()}>?</a></span>}>
|
|
|
|
*This method has no additional advanced call parameters.*
|
|
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
<Admonition type="caution" title="Caution" className="nocli-admonition">
|
|
<div className="addin">
|
|
<strong>NOCLI:</strong> this method is not available in CLI version
|
|
</div>
|
|
</Admonition>
|
|
|
|
|
|
```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.1.0",
|
|
"X-Arr-Log-Id": "ba5c4868-47cb-4c4c-8ac6-2760a60a9367",
|
|
"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"
|
|
}
|
|
```
|