如何更改 WebClient 请求的动词?它似乎只允许/默认为 POST,即使在 DownloadString 的情况下也是如此。
try
{
WebClient client = new WebClient();
client.QueryString.Add("apiKey", TRANSCODE_KEY);
client.QueryString.Add("taskId", taskId);
string response = client.DownloadString(TRANSCODE_URI + "task");
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(response);
}
catch (Exception ex )
{
result = null;
error = ex.Message + " " + ex.InnerException;
}
提琴手说:
POST http://someservice?apikey=20130701-234126753-X7384&taskId=20130701-234126753-258877330210884 HTTP/1.1
Content-Length: 0