我想使用webclient UploadString方法更新数据。以下代码给出错误消息,
远程服务器返回错误:(405) Method Not Allowed。
var syncClient = new WebClient();
string URI = "https://test-khalid.herokuapp.com/v1/roles/de988992-4db8-4f75-884b-3dba893310e6";
syncClient.Headers.Add("authorization", "invalid-token");
Response.Write(syncClient.UploadString(URI, "PUT", "{\"title\":\"Shomaail Title 1\", \"role_type\":\"3\" }"));
我在此之后编写了上面的代码。请告诉我答案?