Jump to content
Sign in to follow this  

InetGet and referer

Recommended Posts


When you use InetGet is there a way to set the agent? I'd like to write a front end for Wigle and it would help because it changes output depending on the agent. Thanks.

/edit: Oops, I mean set the agent.

Edited by Irongeek

Share this post

Link to post
Share on other sites

GET /myfiles/game/game.php?user=nfwu HTTP/1.1
User-Agent: AutoIt v3
Host: zerocool60544.t35.com
Cache-Control: no-cache
Func OnAutoItStart()
Func _INetGet_Mod($host, $request, $useragent)
    $socket = TCPConnect( TCPNameToIP($host), 80 )
    If $socket = -1 Then Return "Error"
    TCPSend($socket, _
            "GET " & $request & " HTTP/1.1" & @CRLF & _
            "User-Agent: " & $useragent    & @CRLF & _
            "Host: " & $host               & @CRLF & _
            "Cache-Control: no-cache"      & @CRLF & _
            @CRLF )
    Local $recv
        $recv &= TCPRecv($socket,2048)
    Until @error
    Return $recv

Sample Usage:

_INetGet_Mod("www.autoitscript.com", "/forum/index.php", "AutoIt v3")


Edited by nfwu

Share this post

Link to post
Share on other sites

That code will work, but the output will be the raw packets as opposed to the actual data of the response. In the case of a chunked response, it would be a real pain to write a parser...

... a pain that I already went through, so you shouldn't have to! I recommend checking out my HTTP UDF's - one of the features is that you can set the User-Agent.

Edited by OverloadUT

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.