2025-05-04 21:43:56 +03:00
---
sidebar_position: 1
2025-05-05 11:15:20 +03:00
description: Add Basic authorization 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
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, HTTP-client]
2025-05-04 21:43:56 +03:00
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Add Basic authorization
Adds standard authorization by username and password
`Function AddBasicAuthorization(Val User, Val Password) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| User | - | String | ✔ | Users name |
| Password | - | String | ✔ | Password |
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"
2025-05-09 21:49:23 +03:00
URL = "https://httpbin.org";
2025-05-09 00:04:38 +03:00
URL = URL + "/get";
Result = OPI_HTTPRequests.NewRequest()
.Initialize()
.SetURL(URL)
.AddBasicAuthorization("user", "password") // <---
.ProcessRequest("GET")
.ReturnResponseAsJSONObject();
2025-05-04 21:43:56 +03:00
```