Hi ,i am trying to create a program to check my e-mail.It's OK ,but i can't login...
I used fiddler to trace the request which were send from my PC and I receive that:
POST http://www.example.com/login.php HTTP/1.1
Host: www.example.com
Connection: keep-alive
Content-Length: 346
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Origin: http://www.example.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBcMYlboao244tr1B
Referer: http://www.example.com
Accept-Encoding: gzip,deflate,sdch
Accept-Language: bg-BG,bg;q=0.8
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.3
Cookie: PHPSESSID=3e3e071jt113oijpv1vg47b612; __utma=239560705.1317507043.1363123547.1363123547.1363123547.1; __utmb=239560705.1.10.1363123547; __utmc=239560705; __utmz=239560705.1363123547.1.1.utmcsr=klammlose.weebly.com|utmccn=(referral)|utmcmd=referral|utmcct=/105710401056.html
------WebKitFormBoundaryBcMYlboao244tr1B
Content-Disposition: form-data; name="navigation"
login
------WebKitFormBoundaryBcMYlboao244tr1B
Content-Disposition: form-data; name="UserID"
USER
------WebKitFormBoundaryBcMYlboao244tr1B
Content-Disposition: form-data; name="Password"
PASSWORD
------WebKitFormBoundaryBcMYlboao244tr1B--
I use that function to send my POST request:
private void defaultPostRequest()
{
try
{
NameValueCollection l_Content = new NameValueCollection();
String l_Url = "http://example.com";
Uri l_Uri = new Uri(l_Url);
l_Content.Add("username", "user");
l_Content.Add("password", "pass");
byte[] l_Response = myWebClient.UploadValues(l_Uri,l_Content);
}
catch (Exception e)
{
textBoxResponse.Text = e.Message;
}
But how to upload the boundaries?!?
Thanks in advance,Nikolay