问题描述
如果您设置了内容处置
头附件
,这将导致用户代理总是present该文件的下载窗口。我想这样做相反的是:强制用户代理总是直接显示的响应。在这种特殊情况下,我有一个的发送JSON的API。我想以服务为应用程序/ JSON
为表示,但由于用户代理通常不承认MIME类型,它们present一个下载窗口。这使得调试在脖子上一个真正的痛苦,所以我想,如果我可以解决这个问题。建议?
If you set the Content-Disposition
header to attachment
, this causes user-agents to always present a download window for that file. I would like to do this opposite of this: force user-agents to always display the response directly. In this particular case, I have an API that's sending JSON. I'd like to serve it as application/json
as indicated by the specification, but since user-agents typically don't recognize the mime type, they present a download window. This makes debugging a real pain in the neck, so I'd like to work around this if I can. Suggestions?
推荐答案
我用来调试JSON在浏览器中的另一种方法是的。
Another method I've used to debug JSON in the browser is the JSONView plugin for Firefox.
这篇关于我怎样才能prevent从$ P $用户代理psenting为无法识别的MIME类型下载窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!