您现在的位置是:主页 > news > 单页面的网站模板免费下载/seo sem是啥

单页面的网站模板免费下载/seo sem是啥

admin2025/5/1 2:01:53news

简介单页面的网站模板免费下载,seo sem是啥,网站建设方案项目背景意义,一家专门做动漫的网站我正在使用Ext.Ajax.request(在sencha toucn 2.3中)将数据发布到我的后端服务器。我想从“成功”回调的“响应”参数中读取一些自定义标题,如下所示:response.getResponseHeader(x-user-session);我非常确定后端服务器会发送回多个标头并且x-user-sessio…

单页面的网站模板免费下载,seo sem是啥,网站建设方案项目背景意义,一家专门做动漫的网站我正在使用Ext.Ajax.request(在sencha toucn 2.3中)将数据发布到我的后端服务器。我想从“成功”回调的“响应”参数中读取一些自定义标题,如下所示:response.getResponseHeader(x-user-session);我非常确定后端服务器会发送回多个标头并且x-user-sessio…

我正在使用Ext.Ajax.request(在sencha toucn 2.3中)将数据发布到我的后端服务器。

我想从“成功”回调的“响应”参数中读取一些自定义标题,如下所示:

response.getResponseHeader('x-user-session');

我非常确定后端服务器会发送回多个标头并且'x-user-session'标头也存在,但有什么奇怪的:当使用“响应”对象时,我只能得到一个标题:“content-型”。

我已经尝试调试到“Ext.data.Connection”类,发现“Ext.data.Connection”中“response”对象的标题也只包含“content-type”标题。

有人能告诉我为什么会这样吗?我的后端程序有什么问题吗?或者只是Ext.Ajax的错误?如何获得我的自定义标题'x-user-session'的值?

谢谢~~

================== ANSWER =====================

这是关于标题的部分:

Access-Control-Expose-Headers (optional) -

The XMLHttpRequest 2 object has a getResponseHeader() method that returns the value of

a particular response header. During a CORS request, the getResponseHeader() method

can only access simple response headers.

Simple response headers are defined as follows:

Cache-Control

Content-Language

Content-Type

Expires

Last-Modified

Pragma

If you want clients to be able to access other headers, you have to use the

Access-Control-Expose-Headers header. The value of this header is a comma-delimited

list of response headers you want to expose to the client.

我还没有验证它,但似乎在正确的轨道上:))

附上屏幕截图:

W8jgC.png

EORrd.png