发送POST请求wget [英] Send POST Request wget

查看:567
本文介绍了发送POST请求wget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试保存包含dopostback链接的CSV文件。

I am trying to save a CSV file that has a dopostback link. I currently have the headers and cookies but am not getting the csv file with wget.

这里是标题:

http://pregame.com/sportsbook_spy/default.aspx

POST /sportsbook_spy/default.aspx HTTP/1.1
Host: pregame.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://pregame.com/sportsbook_spy/default.aspx
Cookie: Ccd=035ad31fe6ae4ecfa471cb7cb6f3a487b42fd4986df80e1a; Scd=0ad1b088c2c4b0097b3a7d3b32c34ec9d1585fde04336f0b; __utma=258943563.1458961190.1370891037.1370891037.1370970458.2; __utmz=258943563.1370891037.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __atuvc=8%7C24; __utmb=258943563.8.10.1370970458; ASP.NET_SessionId=hzk5pwlo3y3kdwuuybcxoliq; AuthorizationCookie=6688A75D-8B99-4CD2-80C5-595236C99E47; __utmc=258943563
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 1092
__EVENTTARGET=ctl00%24content%24ctl00%24w_9613%24_fffffffff60c1bf9%24ctl00%24lbDownload&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKMTgwNjUyODkwM2QYAQU%2BY3RsMDAkY29udGVudCRjdGwwMCR3Xzk2MTUkX2ZmZmZmZmZmZjYwYzFiZjkkY3RsMDAkZ3JkQ29tbWVudHMPPCsADAEIAgFk&ctl00%24header%24ctl00%24w_156%24_fffffffff60c1bf9%24ctl00%24Search1%24SearchText=&ctl00_header_ctl00_w_156__fffffffff60c1bf9_ctl00_Search1_filter=&ctl00%24content%24ctl00%24w_9613%24_fffffffff60c1bf9%24ctl00%24txtGameDt=06%2F11%2F2013&ctl00%24content%24ctl00%24w_9613%24_fffffffff60c1bf9%24ctl00%24hdnAllowDownload=1&ctl00%24content%24ctl00%24w_9613%24_fffffffff60c1bf9%24ctl00%24hfSport=all&ctl00%24content%24ctl00%24w_9613%24_fffffffff60c1bf9%24ctl00%24hfCal=0&ctl00%24content%24ctl00%24w_9615%24_fffffffff60c1bf9%24ctl00%24txtComment=&ctl00%24content%24ctl00%24w_9615%24_fffffffff60c1bf9%24ctl00%24hfParentId=0&ctl00%24content%24ctl00%24w_9615%24_fffffffff60c1bf9%24ctl00%24hfReplyId=0&ctl00%24content%24ctl00%24w_9615%24_fffffffff60c1bf9%24ctl00%24hfReportAbuse=0&ctl00%24content%24ctl00%24w_9615%24_fffffffff60c1bf9%24ctl00%24hfIsLoggedIn=0
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: text/csv; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
x-frame-options: SAMEORIGIN
Telligent-Evolution: 6.1.9.30500
Content-Disposition: attachment; filename=GameInfo.csv
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 11 Jun 2013 17:41:01 GMT
----------------------------------------------------------

对于命令,我使用

wget --load-cookies cookies.txt --post-file post-file http://pregame.com/sportsbook_spy/default.aspx

如何使用POST请求获取此CSV文件?

How do I get this CSV file with a POST request?

推荐答案

尝试使用cUrl命令

curl -i -X POST http://pregame.com/sportsbook_spy/default.aspx -H "Content-Type: text/csv" --data-binary "@file.csv"

如何通过CURL发送文件中指定的数据的POST请求

这篇关于发送POST请求wget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆