pzenz Posted April 17, 2018 Share Posted April 17, 2018 Hi guys, please help me. I´ll drive crazy otherwise. I try to send a http PUT string if a button was pressed. It works with the curl.exe but i dont know how to port it to the autoit tools. Here´s the string i want to send. "curl.exe" -u integrator:integrator --basic -k -i -X PUT https://<IPADRESS>:4001/v1.0/Configuration/RestartSystem --data "value=True" Please help me, how could i do this? Thanks a lot Regards Philipp Link to comment Share on other sites More sharing options...
jdelaney Posted April 17, 2018 Share Posted April 17, 2018 Wrap the whole thing in single quotes. You can still use curl. As always, submit what you have tried, and someone will correct it. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
pzenz Posted April 18, 2018 Author Share Posted April 18, 2018 Hi, here are my first steps. I tried to do this with WinHttp, seems to be the better sollution for this. With WinHttp.au3: Global $hOpen = _WinHttpOpen() Global $hConnect = _WinHttpConnect($hOpen, "https://10.191.7.23") ;Global $hRequestSSL = _WinHttpSimpleSendSSLRequest($hConnect, "-u integrator:integrator --basic https://10.191.7.23:4001/v1.0/Configuration/RestartSystem -k -i -X", "PUT", "--data", "Value=True") Global $hRequestSSL = _WinHttpSimpleSendRequest($hConnect, '-u integrator:integrator --basic https://10.191.7.23:4100/v1.0/Configuration/RestartSystem -k -i -X, "PUT", --data "Value=True"') _WinHttpCloseHandle($hRequestSSL) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) With the normal curl.exe $Username = "integrator" $Password = "integrator" $Http = "https://10.191.7.23:4001/v1.0/Configuration/RestartSystem" $Command = 'curl.exe -u ' & $Username & ":" & $Password & ' --basic -k -i -X PUT ' & $Http & ' --data "value=True" ' Glad to here from you guys.. Thank you verry much Philipp Link to comment Share on other sites More sharing options...
pzenz Posted April 18, 2018 Author Share Posted April 18, 2018 Here another try.. $oHTTP = ObjCreate("winhttp.winhttprequest.5.1");$oHTTP.SetProxy(0) ;No Proxy $user = "integrator" $password = "integrator" $url = "https://10.191.7.23:4001/v1.0/Configuration/RestartSystem" $sGet = $user & ":" & $password & "--basic -k -i- X" & $url & "--data" & "?value=True" $oHTTP.Open("PUT", $sGet, False) ;Post request $oHTTP.Send() ; Send PUT request $RESULT = $oHTTP.ResponseText ; MsgBox(0, "Sent Message", $sReturn) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now