/** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator * https://github.com/OpenAPITools/openapi-generator * Do not edit the class manually. */ #include "OpenAPIBaseModel.h" #include "Async/Async.h" namespace OpenAPI { void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) { ResponseCode = InHttpResponseCode; SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode)); if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout) { SetResponseString(TEXT("Request Timeout")); } } void Response::AsyncRetry() const { // Unfortunately, it is currently usafe to call ProcessRequest() directly here. // This is because the HttpManager will remove all references to this HttpRequest in FHttpManager::Tick including the new request we just added, instead of removing just one. // This will lead to the request's destruction and eventually a crash. // The only solution is therefore to ensure we are taking an extra reference to the request, and that the request is added after the queue is flushed. Async(EAsyncExecution::TaskGraph, [AddRef = FHttpRequestPtr(GetHttpRequest())](){ AddRef->ProcessRequest(); }); } }