Aaron
Aaron

Reputation: 23

System.Net.WebClient and "DELETE" method

If I call System.Net.WebClient.UploadFile(fileUrl, "DELETE", localFileName), is the file at localFileName actually uploaded to the server? Is there a better way to accomplish this?

Upvotes: 2

Views: 5327

Answers (1)

Thomas Levesque
Thomas Levesque

Reputation: 292345

I had a quick look at the WebClient code with Reflector, and it seems to upload the file even if the method is DELETE. I think a better way of doing this would be to use an HttpWebRequest explicitly, where you can specify the method without uploading the file

Upvotes: 4

Related Questions