简体   繁体   中英

HTTP DELETE Request returning a (405) Method Not Allowed Error. Why?

I'm attempting to send a DELETE request through csharp, ASP.NET and its returnin a (405) Error. Below is the code that I'm using:

request = System.Net.HttpWebRequest.Create(myTargetURL); request.Method = "DELETE"; response = (System.Net.HttpWebResponse)request.GetResponse();

Anybody can shed some light on this? is it something I'm not doing from a code point of view?

Looks like everything is working properly on your end and sounds like the server you are sending your DELETE method request to does not allow it.

10.4.6 405 Method Not Allowed

The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM