fielmann Posted April 25, 2008 Share Posted April 25, 2008 Hello autoit-friends!I'd like to send the folowing POST command to my webserver:--------------------------------------------POST /login.php?sid=d620b0ae8c1e8ac0f1155b7dddf054a1 HTTP/1.1Host: www.mywebserver.comUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-aliveReferer: http://www.mywebserver.com/Cookie: Logindata=myuser%B41; PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1Content-Type: application/x-www-form-urlencodedContent-Length: 113PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1&login_name=myuser&login_password=12345&Submit=enter+webserver--------------------------------------------Howto send the POST with included PHPSESSID ? Link to comment Share on other sites More sharing options...
weaponx Posted April 25, 2008 Share Posted April 25, 2008 Did you search?http://www.autoitscript.com/forum/index.ph...=winhttprequest Link to comment Share on other sites More sharing options...
fielmann Posted April 25, 2008 Author Share Posted April 25, 2008 Did you search?http://www.autoitscript.com/forum/index.ph...=winhttprequestI need an example howto realize winhttprequest with PHPSESSID Link to comment Share on other sites More sharing options...
weaponx Posted April 25, 2008 Share Posted April 25, 2008 Would you like me to turn your sheets for you too? Try adding another SetRequestHeader: $oHTTP.SetRequestHeader("Cookie", "PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1") Or maybe you can modify the Send string: $oHTTP.Send("fname=john&lname=smith&PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1") Link to comment Share on other sites More sharing options...
fielmann Posted April 25, 2008 Author Share Posted April 25, 2008 Would you like me to turn your sheets for you too?Try adding another SetRequestHeader:$oHTTP.SetRequestHeader("Cookie", "PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1")Or maybe you can modify the Send string:$oHTTP.Send("fname=john&lname=smith&PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1")How to get the name of the "Cookie" ?Is there any tool that I can catch all needed information for winhttprequest? Link to comment Share on other sites More sharing options...
weaponx Posted April 26, 2008 Share Posted April 26, 2008 How to get the name of the "Cookie" ?Is there any tool that I can catch all needed information for winhttprequest? Yes. I use a plugin for Firefox called livehttpheaders which captures the POST every time you submit a form.http://livehttpheaders.mozdev.org/ Link to comment Share on other sites More sharing options...
fielmann Posted April 26, 2008 Author Share Posted April 26, 2008 Yes. I use a plugin for Firefox called livehttpheaders which captures the POST every time you submit a form.http://livehttpheaders.mozdev.org/OK, I've downloaded and installed the tool.Here is what I captured:POST /login.php?sid=d620b0ae8c1e8ac0f1155b7dddf054a1 HTTP/1.1Host: www.mywebserver.comUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-aliveReferer: http://www.mywebserver.com/Cookie: Logindata=myuser%B41; PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1Content-Type: application/x-www-form-urlencodedContent-Length: 113PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1&login_name=myuser&login_password=12345&Submit=enter+webserverHow to bring this into htttprequest for autoit? Link to comment Share on other sites More sharing options...
weaponx Posted April 26, 2008 Share Posted April 26, 2008 I already showed you. The header is on the left side and the value is on the right. You add all required headers.#511905 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now