Tam*_*ari 22 google-chrome http-headers
如何发送表单的HTTP请求?这是事情,我可以查看" http://www.educationboardresults.gov.bd/lite/index.php " 的结果.
但我想知道浏览器发送请求的格式,以便我可以自动化.我看到了这个问题" 在Google Chrome浏览器中查看HTTP标头? "
但是在chrome中当我查看页面时,我只能看到标题,没有表明表单元素是如何提交的.
基本上我想编写一个程序,对于一组给定的卷号,如100000-110000,我会收集结果,操纵结果作为我的愿望.为此,我需要知道浏览器发送信息请求的格式,即原始http请求.所以我也可以用C发送它.
我知道C中的一些套接字编程.所以我将能够自己编写代码.我只需要知道我将以哪种格式装饰我将发送到服务器的字符串!张贴"东西",这里会有什么东西而不是什么东西?
在Chrome DevTools的Network部分下,右键单击您感兴趣的行,然后从上下文菜单中选择适当的副本类型:
示例剪贴板内容如下所示:
curl 'https://stackoverflow.com/posts/25291052/editor-heartbeat/answer' \
-H 'authority: stackoverflow.com' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
-H 'accept: application/json, text/javascript, */*; q=0.01' \
-H 'x-requested-with: XMLHttpRequest' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36' \
-H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'origin: https://stackoverflow.com' \
-H 'sec-fetch-site: same-origin' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: /sf/ask/1770373671/' \
-H 'accept-language: en,pl;q=0.9,es;q=0.8' \
-H 'cookie: prov=8a6c8983-02cd-669c-367d-61ff657f111e; _ga=GA1.2.1494864357.1594965293; __qca=P0-618917173-1594965293194; __gads=ID=86eda01ab828f223:T=1594965534:R:S=ALNI_MZ6mV2_oJewkg2Z7wubZCCK_dFI0Q; gadsTest=test; sgt=id=9653ade3-9325-4178-a074-d2ff62012690; _gid=GA1.2.480664929.1621240994; acct=t=PYE1PDFUezJZN%2b7eJHz4uQtgdkSgmrsw&s=NfLIf8YH%2f3FPmxGoaPDa2w5sB%2bzihVsv' \
--data-raw 'fkey=39c9ef4d76e1af44087482fe5f9802ac518ce9725a5323015874a7e69a493dea&clientCount=4' \
--compressed
Run Code Online (Sandbox Code Playgroud)
fetch("https://stackoverflow.com/posts/25291052/editor-heartbeat/answer", {
"headers": {
"accept": "application/json, text/javascript, */*; q=0.01",
"accept-language": "en,pl;q=0.9,es;q=0.8",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"pragma": "no-cache",
"sec-ch-ua": "\"Google Chrome\";v=\"89\", \"Chromium\";v=\"89\", \";Not A Brand\";v=\"99\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-requested-with": "XMLHttpRequest"
},
"referrer": "/sf/ask/1770373671/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": "fkey=39c9ef4d76e1af44087482fe5f9802ac518ce9725a5323015874a7e69a493dea&clientCount=4",
"method": "POST",
"mode": "cors",
"credentials": "include"
});
Run Code Online (Sandbox Code Playgroud)
我们还可以选择使用“全部复制为...”选项之一从列表中一次检索特定响应或所有请求。
自己尝试并选择最适合您的选项。
这个网站启发了我的回答。
如果无法在 Chrome 中查看本机的这些信息,您始终可以使用 Web 调试代理 (fe fiddler) 或 Web 渗透测试代理 (fe owasp ZAP)。
那么发送或接收的任何信息都不能被隐藏。您可以以原始格式查看所有内容。如果使用 ZAP,您还可以将所有通信以原始格式记录为文本文件,并且可以拦截请求和响应以进行调试。
归档时间: |
|
查看次数: |
20572 次 |
最近记录: |