forked from loafle/openapi-generator-original
[cpp-ue4] Updated generator to return the http request so that it can be canceled or further manipulated. (#9693)
This commit is contained in:
parent
cce0d0a222
commit
f1ee1cbe2e
@ -35,7 +35,7 @@ public:
|
||||
{{#operations}}{{#operation}}DECLARE_DELEGATE_OneParam(F{{operationIdCamelCase}}Delegate, const {{operationIdCamelCase}}Response&);
|
||||
{{/operation}}{{/operations}}
|
||||
{{#operations}}{{#operation}}{{#description}}/* {{{description}}} */
|
||||
{{/description}}bool {{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate = F{{operationIdCamelCase}}Delegate()) const;
|
||||
{{/description}}FHttpRequestPtr {{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate = F{{operationIdCamelCase}}Delegate()) const;
|
||||
{{/operation}}{{/operations}}
|
||||
private:
|
||||
{{#operations}}{{#operation}}void On{{operationIdCamelCase}}Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, F{{operationIdCamelCase}}Delegate Delegate) const;
|
||||
|
@ -125,10 +125,10 @@ void {{classname}}::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceede
|
||||
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
bool {{classname}}::{{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate /*= F{{operationIdCamelCase}}Delegate()*/) const
|
||||
FHttpRequestPtr {{classname}}::{{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate /*= F{{operationIdCamelCase}}Delegate()*/) const
|
||||
{
|
||||
if (!IsValid())
|
||||
return false;
|
||||
return nullptr;
|
||||
|
||||
FHttpRequestRef HttpRequest = CreateHttpRequest(Request);
|
||||
HttpRequest->SetURL(*(Url + Request.ComputePath()));
|
||||
@ -141,7 +141,8 @@ bool {{classname}}::{{operationIdCamelCase}}(const {{operationIdCamelCase}}Reque
|
||||
Request.SetupHttpRequest(HttpRequest);
|
||||
|
||||
HttpRequest->OnProcessRequestComplete().BindRaw(this, &{{classname}}::On{{operationIdCamelCase}}Response, Delegate);
|
||||
return HttpRequest->ProcessRequest();
|
||||
HttpRequest->ProcessRequest();
|
||||
return HttpRequest;
|
||||
}
|
||||
|
||||
void {{classname}}::On{{operationIdCamelCase}}Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, F{{operationIdCamelCase}}Delegate Delegate) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user