【发布时间】:2018-09-18 08:31:48
【问题描述】:
我正在向 .ashx 处理程序发出异步请求,这在本地没有问题,但是当我将内容发布到服务器时,它不会向我的客户端网站写入响应(其他同步请求也没有问题)。我尝试了很多东西,但无济于事。这是我的处理程序代码:
public override async Task ProcessRequestAsync(HttpContext context)
{
var result = await SomeService.DoSomethingAsync(context.Request["id"]);
context.Response.ContentType = "application/json";
ApplicationLogging.Log(LogType.Info,
$"the result has keys: {string.Join(", ",result.Keys)}");
context.Response.Write(result);
context.Response.End();
}
当我检查日志时,结果正是我所期望的,但响应没有返回给我的客户。
【问题讨论】:
标签: c# .net asynchronous request ashx