Is there a way to do a PUT with WebClient?

后端 未结 4 1124
长发绾君心
长发绾君心 2021-02-11 13:59

with the WebClient class in .NET 4.0, is there a way to do a PUT?

I know you can do a GET with DownloadString() and a POST with UploadString(), but is there a method or

4条回答
  •  终归单人心
    2021-02-11 14:07

    You can use webclient.UploadString(urlwithparams,"Put","")

    url with params should include the params in querystring format ... urlwithparams = www.foo.com?key=value&key2=value2

    This worked for me...

提交回复
热议问题