ExtJS 中的 ScriptTagProxy 执行 OPTIONS 而不是 GET?
就是这样。我正在尝试获取一些美味的跨域 JSON,由于某种原因,尽管我在 ScriptTagProxy 的配置中明确指定了 method:'GET',但正在经历的方法是 OPTIONS。有想法吗?
That's about it. I'm trying to get some delicious cross-domain JSON and for some reason the method that's going through is OPTIONS, even though I've explicitly specified method:'GET' in the config for the ScriptTagProxy. Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这似乎是不可能的,因为“ScriptTagProxy”就像在 html 文档中添加
。
因此,无论您指定什么方法,HTTP 请求都应该是 GET。
如果您确定调用的是“OPTIONS”,也许是您使用的浏览器在
GET
之前发出OPTION
请求? (奇怪的)That seems impossible, since "ScriptTagProxy" is like adding a
<script src="url"></script>
in the html document.So, the HTTP request should a GET, whatever the method you specify.
If you're sure that's "OPTIONS" which is called, maybe it's the browser you're using which makes an
OPTION
request before aGET
? (strange)据我所知,如果您进行 OPTIONS 命中,则意味着您实际上没有使用 scriptTagProxy 而是使用 HttpProxy,所以也许您的配置中有问题?正如 Timdev 评论的那样,代码将有助于识别问题。
To my knowledge if you are making an OPTIONS hit, it means you are actually not using the scriptTagProxy but rather an HttpProxy, so maybe something is wrong in your config ? As timdev commented, code would help to identify the problem.