mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Added the ability for the url-encoded-form serializer to respect the formSerializer config; (#4721)
Added test for `formSerializer` config in context of `url-encoded-form` serializer;
This commit is contained in:
@@ -4,8 +4,8 @@ var utils = require('../utils');
|
||||
var toFormData = require('./toFormData');
|
||||
var platform = require('../platform/');
|
||||
|
||||
module.exports = function toURLEncodedForm(data) {
|
||||
return toFormData(data, new platform.classes.URLSearchParams(), {
|
||||
module.exports = function toURLEncodedForm(data, options) {
|
||||
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
||||
visitor: function(value, key, path, helpers) {
|
||||
if (platform.isNode && utils.isBuffer(value)) {
|
||||
this.append(key, value.toString('base64'));
|
||||
@@ -14,5 +14,5 @@ module.exports = function toURLEncodedForm(data) {
|
||||
|
||||
return helpers.defaultVisitor.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
}, options));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user