fix: post type

This commit is contained in:
DIYgod
2019-06-04 18:28:06 +08:00
parent 218c06f96c
commit ea508b8bc2
28 changed files with 66 additions and 75 deletions

View File

@@ -79,11 +79,7 @@ const custom = got.extend({
(options) => {
// compatible with axios api
if (options.data) {
if (typeof options.data === 'object') {
options.json = options.json || options.data;
} else {
options.body = options.body || options.data;
}
options.body = options.body || options.data;
}
if (options.responseType === 'buffer') {
options.encoding = null;