You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-29 22:27:42 +02:00
66 lines
1.9 KiB
Plaintext
Vendored
66 lines
1.9 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 3
|
|
description: Use body fields at OAuth 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';
|
|
|
|
# Use body fields at OAuth
|
|
Includes or excludes body fields when calculating the OAuth signature depending on server requirements
|
|
|
|
|
|
|
|
`Function UseBodyFiledsAtOAuth(Val Flag) Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Flag | - | Boolean | ✔ | Flag to use body fields in OAuth signature calculation |
|
|
|
|
|
|
Returns: DataProcessorObject.OPI_HTTPClient - This processor object
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
By default, the body data is used in the signature calculation if it was set using the `SetFormBody` function
|
|
:::
|
|
|
|
:::caution
|
|
**NOCLI:** this method is not available in CLI version
|
|
:::
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
URL = "https://httpbin.org";
|
|
URL = URL + "/post";
|
|
|
|
Image = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Path or Binary Data
|
|
|
|
Token = "***";
|
|
Secret = "***";
|
|
UsersKey = "***";
|
|
UsersSecret = "***";
|
|
Version = "1.0";
|
|
|
|
NewRequest = OPI_HTTPRequests.NewRequest().Initialize(URL);
|
|
|
|
Result = NewRequest
|
|
.StartMultipartBody()
|
|
.AddMultipartFormDataFile("file1", "pic.png", Image, "image/png")
|
|
.AddMultipartFormDataField("field1", "Text")
|
|
.AddMultipartFormDataField("field2", "10")
|
|
.UseBodyFiledsAtOAuth(False) // <---
|
|
.AddOauthV1Authorization(Token, Secret, UsersKey, UsersSecret, Version)
|
|
.ProcessRequest("POST")
|
|
.ReturnResponseAsJSONObject();
|
|
```
|
|
|
|
|
|
|
|
|
|
|