Chamlien

How to execute a http delete request by microsoft.xmlhttp

4 posts in this topic


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.
 

Share this post


Link to post
Share on other sites



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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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