# HTTP requests from 1C: GET, POST, headers, auth and timeouts with examples

Source: https://checkcraft.ru/en/guides/1c-http-request.html · updated 2026-11-24

How to send GET and POST from 1C with HTTPConnection and HTTPRequest: host and port, HTTPS, headers, Basic and Bearer auth, query parameters, timeouts…

Practical workflow

Checkcraft is a desktop app for checking APIs and logs without code, with a free edition. [Download, no sign-up →](https://checkcraft.ru/en/download-checkcraft.html#free-download)

In 1C:Enterprise 8.3 an HTTP request is built from two objects: HTTPConnection knows the server, port, secure connection and timeout, and HTTPRequest holds the path, headers and body. Below are working GET and POST samples, auth, parameters and response checks.

Checkcraft · 24 November 2026

Get help with your first test →

## What an HTTP request in 1C consists of

HTTPConnection is created for a server, not a full URL: the first parameter is just the host name without https:// or a path. The path with parameters goes into HTTPRequest. HTTPS needs an OpenSSLSecureConnection object, otherwise the request goes over plain HTTP or fails.

## Which method to call

GET is sent with Get, POST with Post, PUT with Put, DELETE with Delete. For PATCH and any other method use CallHTTPMethod with the method name as the first parameter. All of them return an HTTPResponse with the status code, headers and body.

Repeating checks like this by hand? Checkcraft saves them and reruns them in one click. [Download Free →](https://checkcraft.ru/en/download-checkcraft.html#free-download)

## How to check the response

First the status code, then the content type, and only then the body. A 200 with an HTML login page or a 500 with an error text must not reach JSON parsing. Read the body with GetBodyAsString and an explicit UTF-8 encoding.

## How to repeat the request without 1C

If it is unclear whether 1C or the service is at fault, repeat the same request with curl or an API client using the same address, headers and body. Same result means the service. A different result means 1C sends something else: an extra BOM, another Content-Type, a path with a double slash.

## GET with HTTPS, headers and a token

```
Соединение = Новый HTTPСоединение("api.example.com", 443, , , , 30,
    Новый ЗащищенноеСоединениеOpenSSL(, Новый СертификатыУдостоверяющихЦентровОС));

Запрос = Новый HTTPЗапрос("/api/orders?status=NEW&limit=50");
Запрос.Заголовки.Вставить("Accept", "application/json");
Запрос.Заголовки.Вставить("Authorization", "Bearer " + Токен);

Ответ = Соединение.Получить(Запрос);
Сообщить(Ответ.КодСостояния);
Тело = Ответ.ПолучитьТелоКакСтроку("UTF-8");
```

Query parameters go straight into the HTTPRequest path. Encode values with spaces and Cyrillic with EncodeString and URL encoding, or the server gets something else.

## POST, PUT, DELETE and PATCH

```
Запрос = Новый HTTPЗапрос("/api/orders");
Запрос.Заголовки.Вставить("Content-Type", "application/json; charset=utf-8");
Запрос.УстановитьТелоИзСтроки(СтрокаJSON, "UTF-8", ИспользованиеByteOrderMark.НеИспользовать);

Ответ = Соединение.ОтправитьДляОбработки(Запрос);   // POST
// Соединение.Записать(Запрос)                       // PUT
// Соединение.Удалить(Запрос)                        // DELETE
// Соединение.ВызватьHTTPМетод("PATCH", Запрос)      // любой другой метод
```

## Basic and Bearer auth

```
// Basic: логин и пароль в параметрах соединения
Соединение = Новый HTTPСоединение("erp.example.local", 80, "Обмен", Пароль, , 30);

// или заголовком, если сервис ждёт именно его
Данные = ПолучитьДвоичныеДанныеИзСтроки("Обмен:" + Пароль, КодировкаТекста.UTF8, Ложь);
Запрос.Заголовки.Вставить("Authorization", "Basic " + Base64Строка(Данные));
```

A Bearer token goes in the Authorization header as in the GET example. Keep tokens and passwords in secure storage, not in module code.

## HTTPConnection methods

| HTTP method | 1C method | When |
|---|---|---|
| GET | Получить (Get) | Read data |
| POST | ОтправитьДляОбработки (Post) | Create an object, send data |
| PUT | Записать (Put) | Replace an object |
| DELETE | Удалить (Delete) | Delete an object |
| PATCH and others | ВызватьHTTPМетод (CallHTTPMethod) | Partial updates and custom methods |

## Common mistakes in request code

- A full https:// URL passed to HTTPConnection instead of the host.
- No OpenSSLSecureConnection for HTTPS.
- A UTF-8 body with a BOM, and the partner service answers 400.
- No timeout or one too short for a long operation.
- The response is parsed as JSON without checking the status code.

If the request throws an exception, see [HTTP request error in 1C](https://checkcraft.ru/en/guides/1c-http-request-error.html).

## More on 1C

Section overview and all guides: [1C integration via API: options, architecture and examples](https://checkcraft.ru/en/guides/1c-api-integration.html).

- [HTTP request failed in 1C: causes and fixes](https://checkcraft.ru/en/guides/1c-http-request-error.html)
- [OData in 1C: setup, queries and REST integration with examples](https://checkcraft.ru/en/guides/1c-odata.html)
- [1C web services (SOAP): create, publish, WSDL and calls with examples](https://checkcraft.ru/en/guides/1c-web-service.html)
- [Publishing 1C on IIS and Apache: step by step and common errors](https://checkcraft.ru/en/guides/1c-web-publish.html)
- [JSON in 1C:Enterprise: read, write, HTTP requests and common errors](https://checkcraft.ru/en/guides/1c-json.html)

Next step

## Repeat this on your own API

Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.

[Download Free](https://checkcraft.ru/en/download-checkcraft.html#free-download) · [Download and first run](https://checkcraft.ru/en/download-checkcraft.html)

No sign-up or email needed, the archive is ready in a couple of minutes. See the [edition limits](https://checkcraft.ru/en/pricing.html).

## References

[RFC 9110: HTTP semantics](https://www.rfc-editor.org/rfc/rfc9110)

## Continue with a related task

[HTTP request failed in 1C: causes and fixes](https://checkcraft.ru/en/guides/1c-http-request-error.html) · [1C HTTP services: create, publish, test and debug with examples](https://checkcraft.ru/en/guides/1c-http-service.html) · [JSON in 1C:Enterprise: read, write, HTTP requests and common errors](https://checkcraft.ru/en/guides/1c-json.html) · [cURL examples: GET and POST requests with JSON on Linux, Windows and PowerShell](https://checkcraft.ru/en/guides/curl-post-json.html) · [Configure API request authentication](https://checkcraft.ru/en/guides/api-request-authorization.html)

Start with the linked example and compare its result with your own test requirement.

Ask a person

## Get help with your first test

Tell us what you want to test or where you got stuck. We can help you start Checkcraft, choose an example and understand your first run. You can ask before downloading.

[Ask in Telegram](https://t.me/checkcraftchat)Send an email

The Telegram group is public: do not post passwords, tokens or confidential work data. A description of your task is enough to start.

You can also email us support@checkcraft.ru

Page card: /ai/pages/en/guides/1c-http-request.md
