Jump to content

HTTP UDF


Recommended Posts

#include <HTTP.au3>
#include <IE.au3>
$host = "www.google.com"
$page = "/imghp?hl=en&tab=wi&q="


ConsoleWrite("Example GET Request:"&@CRLF)
$socket = _HTTPConnect($host)
ConsoleWrite("Socket Created: "&$socket&@CRLF)
$get = _HTTPGet($host, $page, $socket)
ConsoleWrite("Bytes sent: "&$get&@CRLF)
$recv = _HTTPRead($socket,1)
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)
    $O_IE = _IECreate()
    _IEBodyWriteHTML( $O_IE , $recv[4] )
EndIf
_HTTPPost($host, $page, $socket, "What should I put here??????" );I want to search for "Prosche"
_HTTPClose($socket)

If I want to print in console also the headers with values, how can I do?

Please help me!

I hate arrays.

Bye.

P.S. I tried with mediafire, but the code gives me only 5 letters, not the whole page!

Edited by BlueDragonBall
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...