Sign in to follow this  
Followers 0
botanic

HTTP Post

4 posts in this topic

I am trying to post some http data

I have the below code however it doesnt seem to work

I get the response from the server however the $_POST is not being sent to the server.

I am trying to pass the value name=Desktop

Case $savedir
            Local $hOpen = _WinHttpOpen()
            Local $hConnect = _WinHttpConnect($hOpen, "http://$url/post.php")
            ; Specify the reguest:
            Local $hRequest = _WinHttpOpenRequest($hConnect, "POST", 'post.php', '', '"name=Desktop"' )


            ; Send request
            _WinHttpSendRequest($hRequest)

            ; Wait for the response
            _WinHttpReceiveResponse($hRequest)

            Local $sHeader = _WinHttpReadData($hRequest) ; ...get full header

            ; Clean
            _WinHttpCloseHandle($hRequest)
            _WinHttpCloseHandle($hConnect)
            _WinHttpCloseHandle($hOpen)


            MsgBox(0, "Header", $sHeader)

Thank you

Share this post


Link to post
Share on other sites



its a real address i just removed the actual ip from the script

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Probably should be something like this:

Local $hConnect = _WinHttpConnect($hOpen, "http://$url")
; Specify the reguest:
Local $hRequest = _WinHttpOpenRequest($hConnect, "POST", "post.php")

; Send request
_WinHttpSendRequest($hRequest, Default, "name=Desktop")
;...
Edited by trancexx

♡♡♡

.

eMyvnE

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