---
sidebar_position: 4
description: Return response as string  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';

# Return response as string 
 Returns the body of the response as a string



`Function ReturnResponseAsString(Val Forced = False, Val ExceptionOnError = False) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Forced | - | Boolean | &#x2716; | False > The processor object will be returned instead of the response if there were errors in it |
  | ExceptionOnError | - | Boolean | &#x2716; | Causes an exception with a log if there were errors during processing |

  
  Returns:  Arbitrary - The response or the same processing object


:::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 + "/post";

    Image = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Path or Binary Data

    Result = OPI_HTTPRequests.NewRequest()
        .Initialize(URL)
        .SetBinaryBody(Image)
        .ProcessRequest("POST")
        .ReturnResponseAsString(); // <---
```
 



```json title="Result"
"{\r\n \"args\": {},\r\n \"data\": \"...\",\r\n \"files\": {},\r\n \"form\": {},\r\n \"headers\": {\r\n  \"Accept\": \"*/*\",\r\n  \"Accept-Charset\": \"utf-8\",\r\n  \"Accept-Encoding\": \"gzip\",\r\n  \"Connection\": \"Keep-Alive\",\r\n  \"Content-Length\": \"2114023\",\r\n  \"Content-Type\": \"application/octet-stream\",\r\n  \"Host\": \"localhost:2424\",\r\n  \"Max-Forwards\": \"10\",\r\n  \"User-Agent\": \"1Script v$2.0.0.0\",\r\n  \"X-Arr-Log-Id\": \"b555aaf5-d62a-4cba-93b1-1b0f96e1ab92\",\r\n  \"X-Arr-Ssl\": \"2048|256|C=BE, O=GlobalSign nv-sa, CN=GlobalSign GCC R6 AlphaSSL CA 2025|CN=*.openintegrations.dev\",\r\n  \"X-Forwarded-Host\": \"bin.openintegrations.dev\",\r\n  \"X-Original-Url\": \"/post\"\r\n },\r\n \"json\": null,\r\n \"origin\": \"***\",\r\n \"url\": \"https://bin.openintegrations.dev/post\"\r\n}"
```
