Jump to content

HTTP Post


botanic
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

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...