|
2 | 2 | (function(root, factory) { |
3 | 3 | if (typeof define === 'function' && define.amd) { |
4 | 4 | // AMD. Register as an anonymous module. |
5 | | - define(['superagent', 'querystring'], factory); |
| 5 | + define(['superagent'], factory); |
6 | 6 | } else if (typeof module === 'object' && module.exports) { |
7 | 7 | // CommonJS-like environments that support module.exports, like Node. |
8 | | - module.exports = factory(require('superagent'), require('querystring')); |
| 8 | + module.exports = factory(require('superagent')); |
9 | 9 | } else { |
10 | 10 | // Browser globals (root is window) |
11 | 11 | if (!root.{{moduleName}}) { |
12 | 12 | root.{{moduleName}} = {}; |
13 | 13 | } |
14 | | - root.{{moduleName}}.ApiClient = factory(root.superagent, root.querystring); |
| 14 | + root.{{moduleName}}.ApiClient = factory(root.superagent); |
15 | 15 | } |
16 | | -}(this, function(superagent, querystring) { |
| 16 | +}(this, function(superagent) { |
17 | 17 | 'use strict'; |
18 | 18 |
|
19 | 19 | {{#emitJSDoc}} /** |
|
432 | 432 | } |
433 | 433 |
|
434 | 434 | if (contentType === 'application/x-www-form-urlencoded') { |
435 | | - request.send(querystring.stringify(this.normalizeParams(formParams))); |
| 435 | + const searchParams = new URLSearchParams(this.normalizeParams(formParams)); |
| 436 | + request.send(searchParams.toString()); |
436 | 437 | } else if (contentType == 'multipart/form-data') { |
437 | 438 | var _formParams = this.normalizeParams(formParams); |
438 | 439 | for (var key in _formParams) { |
|
0 commit comments