seco Posted November 15, 2007 Posted November 15, 2007 Hi i try to use http.au3 with the following code #include <HTTP.au3> $host = "www.google.com" ConsoleWrite("Example GET Request:"&@CRLF) $socket = _HTTPConnect($host) ConsoleWrite("Socket Created: "&$socket&@CRLF) $get = _HTTPGet($host,0, $socket) ConsoleWrite("Bytes sent: "&$get&@CRLF) $recv = _HTTPRead($socket,1) MsgBox(0,"",$recv) If @error Then ConsoleWrite("_HTTPRead Error: "&@error&@CRLF) ConsoleWrite("_HTTPRead Return Value: "&$recv &@CRLF) Else ConsoleWrite("HTTP Return Code: "&$recv[0]&@CRLF) ConsoleWrite("HTTP Return Response: "&$recv[1]&@CRLF) ConsoleWrite("Number of headers: "&UBound($recv[3])&@CRLF) ConsoleWrite("Size of data downloaded: "&StringLen($recv[4])&" bytes"&@CRLF) ConsoleWrite("Page downloaded: "&@CRLF&$recv[4]&@CRLF) EndIf _HTTPClose($socket) it gives me error says :- C:\Program Files\AutoIt3\Include\HTTP.au3(219,26) : ERROR: TimerStart(): undefined function. Dim $timer = TimerStart() any ideas? thanks in advance.
BrettF Posted November 15, 2007 Posted November 15, 2007 Hi i try to use http.au3 with the following code #include <HTTP.au3> $host = "www.google.com" ConsoleWrite("Example GET Request:"&@CRLF) $socket = _HTTPConnect($host) ConsoleWrite("Socket Created: "&$socket&@CRLF) $get = _HTTPGet($host,0, $socket) ConsoleWrite("Bytes sent: "&$get&@CRLF) $recv = _HTTPRead($socket,1) MsgBox(0,"",$recv) If @error Then ConsoleWrite("_HTTPRead Error: "&@error&@CRLF) ConsoleWrite("_HTTPRead Return Value: "&$recv &@CRLF) Else ConsoleWrite("HTTP Return Code: "&$recv[0]&@CRLF) ConsoleWrite("HTTP Return Response: "&$recv[1]&@CRLF) ConsoleWrite("Number of headers: "&UBound($recv[3])&@CRLF) ConsoleWrite("Size of data downloaded: "&StringLen($recv[4])&" bytes"&@CRLF) ConsoleWrite("Page downloaded: "&@CRLF&$recv[4]&@CRLF) EndIf _HTTPClose($socket) it gives me error says :- C:\Program Files\AutoIt3\Include\HTTP.au3(219,26) : ERROR: TimerStart(): undefined function. Dim $timer = TimerStart() any ideas? thanks in advance.TimerStart = TimerInit TimerDiff is also needed somewhere... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
PsaltyDS Posted November 15, 2007 Posted November 15, 2007 That UDF was posted by OverloadUT, but he hasn't been around for over a year. There is a tweaked version at post #25 by Cubehead.You could just tweak your own copy of HTTP.au3. I think replacing TimerStart() with TimerInit() was all that was required. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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