0

我正在使用 Charles 调试 Web 应用程序并对其进行逆向工程。

当我查看来自浏览器的请求时,我可以使用 Charles 查看正文内容应该是什么样子:

{
"projectIds": [1016190671],
"statusId": 11144371
}

当我尝试:

data = {"projectIds": [1016190671], "statusId": 11144371}
client.post(url, headers=headers, data=data)

查尔斯说它是这样通过的:

projectIds=1016190671&statusId=11144371

它们是一样的吗?我的帖子失败了,我认为这就是原因,但我不是 100% 确定。任何意见,将不胜感激。

4

1 回答 1

1

You need to

  1. Add 'Content-type': 'application/json' to your headers
  2. dump the data with json.dumps

If you are trying to post JSON

于 2014-10-09T01:14:38.900 回答