Skip to main content

Return response filename

Returns the path to the response body file

Function ReturnResponseFilename(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: Arbitrary - 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 + "/get";

TFN = GetTempFileName();

Result = OPI_HTTPRequests.NewRequest()
.Initialize(URL)
.SetResponseFile(TFN) // <---
.ProcessRequest("GET")
.ReturnResponseFilename();
Result
"C:\\Users\\Administrator\\AppData\\Local\\Temp\\gussgm53bp2.tmp"