mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-04 02:58:08 +08:00
test: got axios options
This commit is contained in:
@@ -69,21 +69,12 @@ const custom = got.extend({
|
||||
return response;
|
||||
},
|
||||
],
|
||||
onError: [
|
||||
(error) => {
|
||||
error.response.status = error.response.statusCode;
|
||||
return error;
|
||||
},
|
||||
],
|
||||
init: [
|
||||
(options) => {
|
||||
// compatible with axios api
|
||||
if (options.data) {
|
||||
options.body = options.body || options.data;
|
||||
}
|
||||
if (options.responseType === 'buffer') {
|
||||
options.encoding = null;
|
||||
}
|
||||
if (options.params) {
|
||||
options.query = options.query || queryString.stringify(options.params);
|
||||
options.searchParams = options.query; // for Got v11 after
|
||||
|
||||
Reference in New Issue
Block a user