【问题标题】:Node post request on steamSteam 上的节点发布请求
【发布时间】:2020-08-27 18:59:18
【问题描述】:

我正在尝试创建脚本,该脚本可以在我的线程中使用 node 和请求 lib 在我的线程中发表评论。尝试通过执行以下操作来实现:

const body = {
  comment: 'Sometext',
  count: '15',
  sessionid: session_id,
}
bumpingDiscussionsPostsModule.bumpInDiscussion=async() => {
  const postHeader = {
    method: 'POST',
    uri: urlPost,
    headers: {
      Cookie: cookie
    },
    form: JSON.stringify(body)
  }
  const response = await request(postHeader);
  console.log(response);
}

Tho steam 一直让我返回 {"success":false},任何线索我做错了什么?

【问题讨论】:

    标签: node.js request steam


    【解决方案1】:

    我只是格式错误。如果有人可能正在寻找它,这可以完成工作:

    const doBump = await fetch(bumpingUri, {
        method: 'post',
        body: `comment=${process.env.BUMP_COMMENT}&count=15&sessionid=${process.env.CONN_SESID}&extended_data=${process.env.EXTENDED_DATA}&feature2=${featureID}oldestfirst=true&include_raw=true`,
        headers: {
         'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
         'accept': 'text/javascript, text/html, application/xml, text/xml, */*',
          Cookie: process.env.CONN_STRING
        }
      });
    

    【讨论】:

      猜你喜欢
      • 2017-12-24
      • 1970-01-01
      • 2017-12-30
      • 1970-01-01
      • 2017-01-16
      • 2019-08-06
      • 2022-11-30
      • 2014-10-17
      • 1970-01-01
      相关资源
      最近更新 更多