Skip to content

Commit

Permalink
Merge pull request #9036 from silasbw/options0
Browse files Browse the repository at this point in the history
[TypeScript][Node] support for overriding HTTP request headers
  • Loading branch information
HugoMario committed Feb 9, 2019
2 parents 41d2a9d + d0b5fff commit b5150ef
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,9 @@ export class {{classname}} {
{{#allParams}}
* @param {{paramName}} {{description}}
{{/allParams}}
* @param {*} [options] Override http request options.
*/
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: any = {}) : Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
let localVarQueryParameters: any = {};
Expand All @@ -397,6 +398,7 @@ export class {{classname}} {
{{#headerParams}}
localVarHeaderParams['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}");
{{/headerParams}}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0-SNAPSHOT
2.4.1-SNAPSHOT
Loading

0 comments on commit b5150ef

Please sign in to comment.