Skip to main content

Return response

Returns the object of the current HTTP response

Function ReturnResponse(Val Forced = False, Val ExceptionOnError = False) Export

ParameterCLI optionTypeRequiredDescription
Forced-BooleanFalse > The processor object will be returned instead of the response if there were errors in it
ExceptionOnError-BooleanCauses an exception with a log if there were errors during processing

Returns: DataProcessorObject.OPI_HTTPClient, HTTPResponse, Undefined - The response or the same processing object


caution

NOCLI: this method is not available in CLI version


1C:Enterprise/OneScript code example
    URL = "https://httpbin.org";
URL = URL + "/post";

Image = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data

Result = OPI_HTTPRequests.NewRequest()
.Initialize(URL)
.SetBinaryBody(Image)
.ProcessRequest("POST")
.ReturnResponse(); // <---
Result
NOT JSON: HTTPОтвет