Arthfael Posted August 10, 2014 Share Posted August 10, 2014 Hello everyone, I am really new to AutoIt(found it about a week ago) and I really like it but now I am kinda stuck at a problem that is a bit to much for me( for now at least ). I read on the forums and searched on google and I found some stuff regarding my issue but I am don't understand it that good. The thing is I am trying to send HTTPS POST requests to a server so that I am cutting lost time with manually imputing data in a program that a client needs. After a few searches on google I found about a program called Fiddler that scans the connections and after a bit of "pressing buttons" around I found the raw requests that my program to the server. This is the POST request: POST https://trade.xxxxx.xxxxx/IVV HTTP/1.1 Host: trade.xxxxx.xxxxx Connection: keep-alive Content-Length: 24 Origin: https://trade.xxxxx.xxxxx/ X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1003.1 Safari/535.19 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Accept: */* Referer: https://trade.xxxxx.xxxxx/IVV Accept-Encoding: gzip,deflate Accept-Language: en Accept-Charset: iso-8859-1,*,utf-8 Cookie: s=xxxxxxxx-xxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxxx; s=xxxxxxxx-xxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxxx count=5&ccAD=10&ID= Can someone point me in direction on how to simulate this request with AutoIt? P.S: I have tried to modify the scripts found on these links but with no succes. (I don't fully understand the mechanics for now) 1. '?do=embed' frameborder='0' data-embedContent>> 2. '?do=embed' frameborder='0' data-embedContent>> 3. http://brugbart.com/http-post-request-autoit Link to comment Share on other sites More sharing options...
computergroove Posted August 10, 2014 Share Posted August 10, 2014 #include <IE.au3> #include <http.au3> $Header = "Content-Type: application/x-www-form-urlencoded" $Host = "www.sabbgrafix.com" $File = "/welcome.php" $URL = "http://" & $Host & $File $PostData = "name=steve" $hsock = _HTTPConnect("www.google.com", 80) _HTTPGet("www.google.com", "/", $sock) $Socket = _HTTPConnect($Host) _HTTPPost($Host, $File, $Socket, $PostData) $recv = _HTTPRead($Socket,0) MsgBox(0,"","BODY: "&$recv&" ERROR: "&@error) _HTTPClose($Socket) The above looks like it would work. I found it in the first autoit forum post you referenced. What is the problem? Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Arthfael Posted August 10, 2014 Author Share Posted August 10, 2014 Hi and thanks for the reply. The problem is that I don't know how to exactly change the code with the information that I got from Fiddler. One question, is it ok if I use HTTP instead of HTTPS (used by the program)? will that work? Link to comment Share on other sites More sharing options...
computergroove Posted August 10, 2014 Share Posted August 10, 2014 You'll have to test it. How are you reading the information received from fiddler into autoit? Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Developers Jos Posted August 10, 2014 Developers Share Posted August 10, 2014 #include <IE.au3> #include <http.au3> $Header = "Content-Type: application/x-www-form-urlencoded" $Host = "www.sabbgrafix.com" $File = "/welcome.php" $URL = "http://" & $Host & $File $PostData = "name=steve" $hsock = _HTTPConnect("www.google.com", 80) _HTTPGet("www.google.com", "/", $sock) $Socket = _HTTPConnect($Host) _HTTPPost($Host, $File, $Socket, $PostData) $recv = _HTTPRead($Socket,0) MsgBox(0,"","BODY: "&$recv&" ERROR: "&@error) _HTTPClose($Socket) The above looks like it would work. I found it in the first autoit forum post you referenced. What is the problem? Have you tried it to see its free of errors before posting? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Arthfael Posted August 10, 2014 Author Share Posted August 10, 2014 I am using Fiddler to find the session key that the program randomly assigns every time I start the program. ( Cookie: s=xxxxxxxx-xxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxxx; s=xxxxxxxx-xxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxxx ) Regarding AutoIt, I want to use it to sent requests with different Count and ccAD ( count=5&ccAD=10&ID= ) every 3seconds. I have the counts and ccAD's in a excel sheet Link to comment Share on other sites More sharing options...
computergroove Posted August 10, 2014 Share Posted August 10, 2014 Have you tried it to see its free of errors before posting? Hey Jos, My bad. No I did not. #include <IE.au3> #include <http.au3> $Header = "Content-Type: application/x-www-form-urlencoded" $Host = "www.sabbgrafix.com" $File = "/welcome.php" $URL = "http://" & $Host & $File $PostData = "name=steve" $hsock = _HTTPConnect("www.google.com", 80) _HTTPGet("www.google.com", "/", $hsock) $Socket = _HTTPConnect($Host) _HTTPPost($Host, $File, $Socket, $PostData) $recv = _HTTPRead($Socket,0) MsgBox(0,"","BODY: "&$recv&" ERROR: "&@error) _HTTPClose($Socket) Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Developers Jos Posted August 10, 2014 Developers Share Posted August 10, 2014 Hey Jos, My bad. No I did not. Guess you haven't read my other post around this topic I made earlier in another thread directed towards you. It is great when you want to help people, but try to answer their question with something that at least works most of the time as this is by far not the first time I have played this game with you. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Arthfael Posted August 10, 2014 Author Share Posted August 10, 2014 (edited) Thanks for the help. I will try to figure out how to modify it to work for my needs Edited August 10, 2014 by Arthfael 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