I have to download an excel file from a website through code. But the downloading requires logging into a website. So I am confused that what data should I post to login from code.
Here's the request from chrome:
Request URL:https://206.82.192.135:4100/wgcgi.cgi?action=fw_logon&style=fw_logon.xsl&fw_logon_type=status
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:884
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Cookie:domain=null; username=CandA
Host:206.82.192.135:4100
Origin:https://206.82.192.135:4100
Referer:https://206.82.192.135:4100/wgcgi.cgi?action=fw_logon&style=fw_logon.xsl&fw_logon_type=status
User-Agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
Query String Parametersview sourceview URL encoded
action:fw_logon
style:fw_logon.xsl
fw_logon_type:status
Request Payload
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Content-Disposition: form-data; name="fw_username"
[username appears here]
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Content-Disposition: form-data; name="fw_password"
[password appears here]
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Content-Disposition: form-data; name="fw_domain"
Firebox-DB
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Content-Disposition: form-data; name="fw_domain"
Firebox-DB
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Content-Disposition: form-data; name="submit"
Login
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Content-Disposition: form-data; name="action"
fw_logon
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Content-Disposition: form-data; name="style"
fw_logon_progress.xsl
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic
Content-Disposition: form-data; name="fw_logon_type"
logon
------WebKitFormBoundaryPAzPZF4h5AQHA6Ic--
Response Headersview source
Connection:close
Content-Length:289
Content-Type:text/xml
Date:Wed, 21 Aug 2013 13:00:10 GMT
Server:None