by jimmy6 posted on 2005/01/05 |
|
[code] protected string GetHttpRequest(Url url)
{
string request = "POST " + (url.Path.Length == 0 ? "/" : url.Path) + (url.Query.Length == 0 ? "" : ("?" + url.Query)) + " HTTP/1.0\r\n";
request += "Accept: */*\r\nUser-Agent: Mentalis.org SecureSocket\r\nHost: " + url.Host + "\r\n";
if (url.Username.Length != 0)
request += "Authorization: Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(url.Username + ":" + url.Password)) + "\r\n";
return request + "\r\n";
}[/code]
output is:
GET /adsense/login.do HTTP/1.0
Accept: */*
User-Agent: Mentalis.org SecureSocket
Host: www.google.com
I use Org.Mentalis.Security.dll to connect this website(www.google.com/adsense/login.do). My question is how to change the GET to POST? Then how to pass the email and passwors for login?
|