request({
json: true,
uri: 'https://api-api.com/token',
form: {
type: '',
code: ,
id: '',
}
})
request({
json: true,
uri: 'https://api-api.com/token',
form: {
type: '',
code: ,
id: '',
}
})
GET
,并且 form 会被丢弃。
以下是相关源码:
// https://github.com/request/request/blob/master/request.js#L161
if (!self.method) {
self.method = options.method || 'GET'
}
13 回答12.6k 阅读
2 回答4.9k 阅读✓ 已解决
7 回答1.8k 阅读
9 回答1.6k 阅读✓ 已解决
3 回答2.1k 阅读✓ 已解决
8 回答2.1k 阅读
5 回答641 阅读
request默认的就是get请求,无论后面的可选参数是body还是form。