Sign in to follow this  
Followers 0
AzKay

My "http wrapper"

6 posts in this topic

#1 ·  Posted (edited)

Just a helpful copypasta script that I made.

Might help others.

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
ConsoleWrite(_HTTPRequest($oHTTP, "GET", "http://google.com") & @CRLF)

Func _HTTPRequest($oHTTP, $oMethod, $oURL, $oData = "")
    $oHTTP.Open($oMethod, $oURL, False)
    If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    $oHTTP.Send($oData)
    Return $oHTTP.ResponseText
EndFunc

EDIT::

Typo'd. Thanks Manadar

Edited by AzKay

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites



^ bugfixed.

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
ConsoleWrite(_HTTPRequest($oHTTP, "GET", "http://google.com") & @CRLF)

Func _HTTPRequest($oHTTP, $oMethod, $oURL, $oData = "")
    $oHTTP.Open($oMethod, $oURL, False)
    If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    $oHTTP.Send($oData)
    Return $oHTTP.ResponseText
EndFunc

Share this post


Link to post
Share on other sites

Oh right. Thanks for that xD


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

this look simliar to InGetSource... does do the same function and any advantages..

Share this post


Link to post
Share on other sites

this look simliar to InGetSource... does do the same function and any advantages..

Wrong.

This allows you to set the header, and many other things if you know what you're doing. It's InetGetSource advanced. 8)

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  
Followers 0