对于成功(ACKs / StatusCode == 200)和不成功(NACKs / StatusCode != 200)发布,如何通过 HTTP 发送适配器检索由 POST 产生的自定义 HTTP ResponseStatusDescription
即来自提琴手的回应:
HTTP/1.1 200 ResponseStatusDescription
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 23 Nov 2012 10:19:06 GMT
2c
This is the response body, statuscode: '200'
0
无效响应示例:
HTTP/1.1 408 Custom Status Description
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 23 Nov 2012 14:42:37 GMT
2c
This is the response body, statuscode: '408'
0
如果有帮助,我正在测试一个简单的 asp.net Web 项目,其中 Page_Load 被覆盖,如下所示:
protected void Page_Load(object sender, EventArgs e)
{
Response.SuppressContent = false;
//Response.StatusCode = 200;
Response.StatusCode = 400;
Response.StatusDescription = "ResponseStatusDescription";
string Resp = string.Format("This is the response body, statuscode: '{0}'", Response.StatusCode);
Response.Write(Resp);
Response.Flush();
}