forked from loafle/openapi-generator-original
[csharp] Update UserAgent in the async version of ClientAPI execute method. (#3723)
* move UserAgent up to the constructor * userAgent on both constructors. * update location of UserAgent * re-ran the petstore generation
This commit is contained in:
parent
a748e1ff9a
commit
62ca0c78ff
@ -245,6 +245,7 @@ namespace {{packageName}}.Client
|
|||||||
var request = PrepareRequest(
|
var request = PrepareRequest(
|
||||||
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||||
pathParams, contentType);
|
pathParams, contentType);
|
||||||
|
RestClient.UserAgent = Configuration.UserAgent;
|
||||||
InterceptRequest(request);
|
InterceptRequest(request);
|
||||||
var response = await RestClient.Execute{{^netStandard}}TaskAsync{{/netStandard}}(request);
|
var response = await RestClient.Execute{{^netStandard}}TaskAsync{{/netStandard}}(request);
|
||||||
InterceptResponse(request, response);
|
InterceptResponse(request, response);
|
||||||
|
@ -202,6 +202,7 @@ namespace Org.OpenAPITools.Client
|
|||||||
var request = PrepareRequest(
|
var request = PrepareRequest(
|
||||||
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||||
pathParams, contentType);
|
pathParams, contentType);
|
||||||
|
RestClient.UserAgent = Configuration.UserAgent;
|
||||||
InterceptRequest(request);
|
InterceptRequest(request);
|
||||||
var response = await RestClient.ExecuteTaskAsync(request);
|
var response = await RestClient.ExecuteTaskAsync(request);
|
||||||
InterceptResponse(request, response);
|
InterceptResponse(request, response);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user