(500)内部服务器错误 - 当使用发送Web请求API [英] (500) Internal Server Error - When sending web request using api
问题描述
我发送一个网络请求并得到内部服务器错误:500
我怎么能确定哪一方负责收到此错误? 我的侧面或外部API的一面?
我didn`t看到我的事件查看器日志。
这是我的code:
VAR请求= WebRequest.Create(http://saas.appoxee.com/api/)作为HttpWebRequest的;
request.Method = WebRequestMethods.Http.Post;
request.ContentType =应用/ JSON;
//添加内容到请求
字符串postDataJsonFormat = CreateExampleTagRequest();
字节[]的字节数组= Encoding.UTF8.GetBytes(postDataJsonFormat);
request.ContentLength = byteArray.Length;
流式传输的数据流= request.GetRequestStream();
dataStream.Write(字节数组,0,byteArray.Length);
dataStream.Close();
//获取和处理响应
变种响应= request.GetResponse()作为HttpWebResponse;
500.0 - 内部服务器错误是一个IIS错误code的含义,网络服务不可用。这意味着错误的API,而不是你的客户。
服务器codeS摘要:
1XX - 信息
2XX - 成功
3XX - 重定向
4XX - 客户端错误
5XX - 服务器错误
有关的codeS的完整列表,看看这里: http://support.microsoft.com/ KB / 943891 大约在 500 code具体为: http://support.microsoft。 COM / KB / 942031
I am sending a web request and getting internal server error : 500.
How can i be sure what side is responsible for getting this error? My side or the external api side?
I didn`t see logs in my event viewer.
This is my code:
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;
"500.0 – Internal Server Error" is an IIS Error code meaning that the web service is unavailable. This means the error is with the API, not your client.
Summary of server codes:
1xx - Informational
2xx - Success
3xx - Redirection
4xx - Client error
5xx - Server error
For a full list of codes look here: http://support.microsoft.com/kb/943891 and about the 500 code specifically: http://support.microsoft.com/kb/942031
这篇关于(500)内部服务器错误 - 当使用发送Web请求API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!