You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-29 22:27:42 +02:00
52 lines
1.4 KiB
Plaintext
Vendored
52 lines
1.4 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 3
|
|
description: Send data in parts and other functions to work with HTTP-client 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-client]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Send data in parts
|
|
Sends the body in multiple requests with the Content-Range header
|
|
|
|
|
|
|
|
`Function SendDataInParts(Val ChunkSize = 5242880, Val Method = "PUT") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| ChunkSize | - | Number | ✖ | Size of one part for sending |
|
|
| Method | - | String | ✖ | Request HTTP method |
|
|
|
|
|
|
Returns: DataProcessorObject.OPI_HTTPClient - This processor object
|
|
|
|
<br/>
|
|
|
|
|
|
:::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;
|
|
Image = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Path or Binary Data
|
|
|
|
Result = OPI_HTTPRequests.NewRequest()
|
|
.Initialize(URL)
|
|
.SetBinaryBody(Image)
|
|
.SendDataInParts(ChunkSize) // <---
|
|
.ReturnResponseAsJSONObject();
|
|
```
|
|
|
|
|
|
|
|
|
|
|