我的代码:
string postData = "'Country+Code':'US'&'Start+Date':'2018-01-01'&'End+Date':'2018-07-02'";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
request.Headers["Authorization"] = "Bearer " + accessToken;
var response = (HttpWebResponse)request.GetResponse();
我收到404 not found错误:
我猜Post数据有问题,所以我很喜欢:
//string postData = "'Country Code':'US'&'Start Date':'2018-01-01'&'End Date':'2018-07-02'";
// string postData = "Country Code:'US':1&Start Date:'2018-01-01'&End Date:'2018-07-02'";
但仍然出现错误:找不到404, 找到正确的方法?
答案 0 :(得分:0)
如果您收到的HTTP状态为404(找不到方法),则可能会出现这种错误: