Ajax 响应中缺少 http 标头

发布于 2024-09-05 21:29:13 字数 248 浏览 4 评论 0原文

我遇到 Ajax 响应中缺少一些 http 标头的问题。 ajax 页面 (.NET) 使用 Me.Response.AddHeader("ResponseCode", mResponseCode) 将一些附加信息添加到 http 标头。如果我直接访问 ajax 页面并使用 httpAnalyser 检查标头,我可以看到标头已正确添加。但是当我通过 jQuery 调用 Ajax 页面时,标头丢失了。

我很困惑。有人可以帮助我吗?

此致, 史蒂芬

I'm having an issue with some missing http headers in a Ajax response. The ajax-page (.NET) adds som additional info to the http header by using Me.Response.AddHeader("ResponseCode", mResponseCode). If I access the ajax-page directly and use httpAnalyser to check the headers, I can see that the headers are added correctly. But when I call the Ajax page through jQuery, the headers are missing.

I'm puzzled. Anyone out there that can help me?

Best regards,
Steffen

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日暮斜阳 2024-09-12 21:29:13

在完整或成功方法中,第一个参数是包含此信息的 XMLHttpRequest 对象。您可以像这样检索任何响应标头:

xmlHttpRequest.getResponseHeader('header-name');

In your complete or success method the first parameter is an XMLHttpRequest object that contains this information. You can retrieve any response header like this:

xmlHttpRequest.getResponseHeader('header-name');
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文