diff --git a/src/main/resources/handlebars/typescript-angular/api.service.mustache b/src/main/resources/handlebars/typescript-angular/api.service.mustache index 4a4742ff36..e25822b31f 100644 --- a/src/main/resources/handlebars/typescript-angular/api.service.mustache +++ b/src/main/resources/handlebars/typescript-angular/api.service.mustache @@ -320,9 +320,14 @@ export class {{classname}} { {{/hasFormParams}} {{#useHttpClient}} - return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#hasBodyParam}} - {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/hasBodyParam}} + return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}({{httpMethod}},`${this.basePath}{{{path}}}`, { +{{#bodyParam}} + body: {{paramName}} +{{/bodyParam}} +{{#hasFormParams}} + body: convertFormParamsToString ? formParams.toString() : formParams +{{/hasFormParams}} {{#hasQueryParams}} params: queryParameters, {{/hasQueryParams}} diff --git a/src/main/resources/mustache/typescript-angular/api.service.mustache b/src/main/resources/mustache/typescript-angular/api.service.mustache index 4a4742ff36..e25822b31f 100644 --- a/src/main/resources/mustache/typescript-angular/api.service.mustache +++ b/src/main/resources/mustache/typescript-angular/api.service.mustache @@ -320,9 +320,14 @@ export class {{classname}} { {{/hasFormParams}} {{#useHttpClient}} - return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#hasBodyParam}} - {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/hasBodyParam}} + return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}({{httpMethod}},`${this.basePath}{{{path}}}`, { +{{#bodyParam}} + body: {{paramName}} +{{/bodyParam}} +{{#hasFormParams}} + body: convertFormParamsToString ? formParams.toString() : formParams +{{/hasFormParams}} {{#hasQueryParams}} params: queryParameters, {{/hasQueryParams}}