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'
}
10 回答11.7k 阅读
2 回答3.2k 阅读✓ 已解决
2 回答4.2k 阅读✓ 已解决
4 回答4.6k 阅读✓ 已解决
3 回答1.9k 阅读✓ 已解决
4 回答2.1k 阅读✓ 已解决
2 回答1.7k 阅读✓ 已解决
request默认的就是get请求,无论后面的可选参数是body还是form。