安装:cnpm install request
使用:
POST application/json
request({
url: url,
method: "POST",
json: true,
headers: {
"content-type": "application/json",
},
body: JSON.stringify(requestData)
}, function(error, response, body) {
if (!error && response.statusCode == 200) {
}
});
本文介绍如何利用cnpminstallrequest工具完成POST请求操作,包括设置请求头、构造请求体及处理响应等内容。
12万+

被折叠的 条评论
为什么被折叠?



