6
我將Nancy用作應用程序的休息後端。 目前,我已經成功地定位頭部添加到我的回答與此技巧:將位置標題添加到NancyFx中的響應的正確方法
var headerUri = Request.Url.SiteBase + Request.Path + "/" + processedModel.Id.ToString();
Response response = new JsonResponse(processedModel,Response.Serializers.First(s => s.CanSerialize("application/json")));
response.Headers["Location"] = headerUri;
return response;
正如我也只想返回JSON結果,這將是最好的解決辦法?