Fel*_*Net 5 .net c# api httpwebrequest
我正在发送Web请求并收到内部服务器错误:500。
我如何确定哪一方负责导致此错误?我这边还是外部api?
我没有在事件查看器中看到日志。
这是我的代码:
var request = WebRequest.Create("http://saas.appoxee.com/api/") as HttpWebRequest;
request.Method = WebRequestMethods.Http.Post;
request.ContentType = "application/json";
// Add the content to the request
string postDataJsonFormat = CreateExampleTagRequest();
byte[] byteArray = Encoding.UTF8.GetBytes(postDataJsonFormat);
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
// Getting and processing the response
var response = request.GetResponse() as HttpWebResponse;
Run Code Online (Sandbox Code Playgroud)
“ 500.0 –内部服务器错误 ”是IIS错误代码,表示该Web服务不可用。这意味着错误是由API引起的,而不是您的客户端。
服务器代码摘要:
1xx-信息性
2xx-成功
3xx-重定向
4xx-客户端错误
5xx-服务器错误
有关代码的完整列表,请参见:http : //support.microsoft.com/kb/943891, 以及有关500个代码的专门信息:http : //support.microsoft.com/kb/942031
| 归档时间: |
|
| 查看次数: |
26977 次 |
| 最近记录: |