HttpWebRequest-删除“方法不允许”。 [英] HttpWebRequest- Deletion “Method Not Allowed.”

查看:104
本文介绍了HttpWebRequest-删除“方法不允许”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用WebRequest删除远程图像(特别是通过http)

但是我收到以下错误消息:



远程服务器返回错误:(405)Method Not Allowed。。

这是我正在使用的代码...



I'm trying to delete a remote image using WebRequest (specifically through http)
but I'm getting the following error message :

"The remote server returned an error: (405) Method Not Allowed.".
This is the code that I'm using...

WebRequest webRequest = WebRequest.Create("http://localhost/TestImage/5045.jpg");
webRequest.Method = WebRequestMethods.Ftp.DeleteFile; // "DELETE";
HttpWebResponse httpReponse = (HttpWebResponse)webRequest.GetResponse();





请建议......

谢谢。



Please advice...
thanks.

推荐答案

这意味着不允许删除。 :-)

是什么让你认为你可以删除它?如果您无法访问服务器,请放松一下。如果你这样做,你可以改变服务器的设置,如果你是<勇敢的话;在这种情况下,请阅读产品文档。



-SA
It's means that deletion is not allowed. :-)
What makes you thinking that you can delete it? If you don't have access to the server, just relax. If you do, you can change your server's setting if you are so brave to do so; in this case, read the product's documentation.

—SA


这篇关于HttpWebRequest-删除“方法不允许”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆