News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
GET to POST  
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?

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2005/01/06

=> http://www.ietf.org/rfc/rfc2616.txt

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.