【发布时间】:2018-07-19 17:57:00
【问题描述】:
所以我正在使用 Node.JS 请求模块,我希望将 recaptcha 令牌(一旦解决就会生成)放入我的请求中,但我不确定我是如何实现的。
这是我目前的代码,虽然我尝试了一个表单,但还是不行。
function fireVote(username, captchaKey){
rp({
uri: voteUrl,
method: "POST",
qs: {
"username": username,
"g-recaptcha-response": captchaKey
},
headers: {
'User-Agent': "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
}
}).then(body => {
console.log(body);
if(body.includes("Voted")){
console.log("Done!");
}
})
}
谢谢!
【问题讨论】:
标签: node.js http-post token recaptcha