或许你应该学学 postman
简单模拟请求的工具 (๑• . •๑)

最简单的方法就是直接在浏览器中复制 Copy as cURL ,然后把数据导入 postman,然后 send ,收工。
我们这里拿 知乎首页 举例

在对应的请求下复制 cURL
打开 postman , 点击左上角的 Import , 选择Paste Raw Text ,最后 Import,点击 send发送请求

发送请求之后就可以查看了,如下图,标箭头的地方可以打开看更多。比如可以预览web界面,查看 Headers 信息,查看状态,复制代码。

同时可以打开 Headers ,用来调试,哪些是需要的,哪些不需要

最方便的一点是,可以直接生成对应的编程语言,并复制,例如Python的requests方法:

好了,到这里 postman 的简单功能就说完了,他的全部功能当然不止这一点,更多的就去看 文档啦
在我的使用过程中,发现了 postman 的一些问题,如:导入错误,参数错误,请求失误。
例如知乎这个例子,如果我们复制的是 Copy as cURL (cmd) ,可能你会遇到下面的错误

这个时候选用 Copy as cURL (bush) 就好了,具体原因是啥,我也不清楚。我在这里找到了别人的描述
There is no difference between the two cURL command because there is a difference between ” and ‘.
Refer : Use cURL to get the same results as a web browser
举个例子,今天在帮朋友查看 这个网站 的翻页,复制用postman打开, copy cURL 内容是

导入之后,send,返回 400 错误。
postman 转义的code是:

可以看到 加入了大量的 ^ 符号,这个在Python中是运算符
^ 按位异或运算符:当两对应的二进位相异时,结果为1 (a ^ b) 输出结果 49 ,二进制解释: 0011 0001