带有 ExtJS 4 商店的 HTTP 标头 [英] HTTP Headers with ExtJS 4 Stores

查看:23
本文介绍了带有 ExtJS 4 商店的 HTTP 标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实例化了几家商店.但在某个时候,我会在所有这些中添加一个 HTTP 标头.我怎么能用 ExtJS 4 做到这一点?

I have already a few stores instanciated. But at a certain point, I'd to add a HTTP header in all of them. How can I do that, with ExtJS 4 ?

推荐答案

假设您使用的是 ajax 代理,您可以更新 headers 相关商店的属性.查看代码,它将应用其中的任何内容作为标题.

Assuming that you are using an ajax proxy, you could update the headers property on the stores in question. Looking at the code it'll apply whatever is in there as the headers.

一个更复杂的解决方案是覆盖 doRequest 函数来做任何适合你的事情.

A more involved solution would involve overriding the doRequest function to do whatever suited you.

这篇关于带有 ExtJS 4 商店的 HTTP 标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆