Hi,
I'm trying to mimic a http POST request like the one below, called by FireFox in a single frame (copied from Microsoft Network Manager)
- Http: Request, POST /popup_delete.php, Query:id=11598
Command: POST
- URI: /popup_delete.php?id=11598
Location: /popup_delete.php
- Parameters: 0x1
id: 11598
ProtocolVersion: HTTP/1.1
Host: mywebsite.com
UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.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://mywebsite.com/popup_delete.php?id=11598
- Cookie: PHPSESSID=qq38t431qmcnb0kon93pt8u9t3; BIGipServeredms_80=307931328.20480.0000; authchallenge=8443ef4fe946eb285e0d9426f622b122
PHPSESSID: qq38t431qmcnb0kon93pt8u9t3
BIGipServeredms_80: 307931328.20480.0000
authchallenge: 8443ef4fe946eb285e0d9426f622b122
Connection: keep-alive
- ContentType: application/x-www-form-urlencoded
MediaType: application/x-www-form-urlencoded
ContentLength: 15
HeaderEnd: CRLF
- payload: HttpContentType = application/x-www-form-urlencoded
confirm: Confirm
so I wrote this..
var client = new CookieAwareWebClient();
client.BaseAddress = @"http://mywebsite.com";
var loginData = new NameValueCollection();
loginData.Add("id", "myusername");
loginData.Add("password", "mypassword");
client.UploadValues("sign_in.php?", "POST", loginData);
string RouteID = "11598";
var deleteData = new NameValueCollection();
deleteData.Add("confirm", "Confirm");
string DeleteURI = string.Format("popup_delete.php?id={0}", routeID);
client.Headers.Add("Referer", string.Format("http://mywebsite.com/{0}", DeleteURI));
client.UploadValues(DeleteURI, "POST", deleteData);
resulted in this frame..
- Http: Request, POST /popup_delete.php, Query:id=11598
Command: POST
- URI: /popup_delete.php?id=11598
Location: /popup_delete.php
- Parameters: 0x1
id: 11598
ProtocolVersion: HTTP/1.1
- ContentType: application/x-www-form-urlencoded
MediaType: application/x-www-form-urlencoded
Referer: http://mywebsite.com/popup_delete.php?id=11598
Host: mywebsite.com
- Cookie: PHPSESSID=pdoev4k0gq8ddg3gvidhuqkb14; BIGipServeredms_80=307931328.20480.0000
PHPSESSID: pdoev4k0gq8ddg3gvidhuqkb14
BIGipServeredms_80: 307931328.20480.0000
ContentLength: 15
Connection: Keep-Alive
HeaderEnd: CRLF
and later this frame..
- Http: HTTP Payload, URL: /popup_delete.php
- payload: HttpContentType = application/x-www-form-urlencoded
confirm: Confirm
In Firefox, payload was sent in the same frame but in my code, payload was sent in the next frame. I'm trying to delete an entry by mimicking what Firefox is sending. At the moment, my method is not successful.