Chamlien Posted October 17, 2015 Share Posted October 17, 2015 How to use winhttp or xmlhttp to send a delete request?Here is the trying but failed:1.$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")$oHTTP.Open("delete", $Url, False)2.$oHTTP = ObjCreate("microsoft.xmlhttp")$oHTTP.Open("delete", $Url, False)3.$oHTTP = ObjCreate("MSXML2.XMLHTTP")$oHTTP.Open("delete", $Url, False)All example above can't be used to execute delete request.It seems that all those methods don't contain a delete method. Link to comment Share on other sites More sharing options...
FireFox Posted October 17, 2015 Share Posted October 17, 2015 Hi Chamlien,Have you tried to use the WinHTTP UDF ?Take a look at the _WinHttpOpenRequest function, it has a parameter where you can specify the method (in your case "DELETE").Br, FireFox. Link to comment Share on other sites More sharing options...
Chamlien Posted October 18, 2015 Author Share Posted October 18, 2015 Hi Chamlien,Have you tried to use the WinHTTP UDF ?Take a look at the _WinHttpOpenRequest function, it has a parameter where you can specify the method (in your case "DELETE").Br, FireFox.Hi FireFox,I found that WinHTTP have DELETE Method, but I need to set many request headers, so How to set more than three request headers like this: $oHTTP.setRequestHeader("Accept", "*, */*") $oHTTP.setRequestHeader("Accept-Encoding", "identity") $oHTTP.setRequestHeader("Content-Type", "text/xml") $oHTTP.setRequestHeader("Connection", "keep-alive")Thanks for answering very much. Link to comment Share on other sites More sharing options...
FireFox Posted October 22, 2015 Share Posted October 22, 2015 Hi FireFox,I found that WinHTTP have DELETE Method, but I need to set many request headers, so How to set more than three request headers like this: $oHTTP.setRequestHeader("Accept", "*, */*") $oHTTP.setRequestHeader("Accept-Encoding", "identity") $oHTTP.setRequestHeader("Content-Type", "text/xml") $oHTTP.setRequestHeader("Connection", "keep-alive")Thanks for answering very much.I don't know, just use the WinHTTP UDF, it's made for that ; to make things simple and not having to interact with the object.Br, FireFox. 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