获取IIS6以提供JSON文件(包括POST,GET)? [英] Get IIS6 to serve JSON files (inc. POST,GET)?

查看:122
本文介绍了获取IIS6以提供JSON文件(包括POST,GET)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,IIS6不提供.json(没有通配符 MIME 类型)。

By default, IIS6 does not serve .json (no wildcard MIME type).

因此404找不到被抛出。然后我添加一个新的MIME类型(.json,text / plain或application / x-javascript或application / json)哪个工作正常。

Therefore a 404 not found is thrown. I then add a new MIME type (.json, text/plain or application/x-javascript or application/json) which works fine.

但是,当您随后使用.json添加新映射(主目录 - >配置 - >添加)时,C:\ WINDOWS \ system32 \inetsrv \\ \\ asp.dll GET,POST 并尝试浏览到该文件,获得404.

However, when you then add a new mapping (Home Directory -> Configuration -> Add) with .json, C:\WINDOWS\system32\inetsrv\asp.dll, "GET,POST" and try to browse to the file, you get a 404.

如果删除映射并尝试 POST或GET ,则得到 405

If you remove the mapping and try and POST or GET to it, you get a 405.

...

建议?

推荐答案

默认情况下,W2K3及更高版本中的IIS不会提供不属于它所知道的MIME类型的文件(而是返回404错误)。

By default, IIS in W2K3 and above won't serve files that aren't of a MIME type that it knows about (instead returning 404 errors).

您需要向IIS添加MIME类型以允许它提供该类型的文件。您可以在站点级别或服务器级别设置它。

You need to add a MIME type to IIS to allow it to serve that type of file. You can set it at the site level or at the server level.

为整个服务器设置此项:

To set this for the entire server:


  • 在IIS管理器中打开服务器的属性,然后单击MIME类型

  • 单击新建。输入JSON作为扩展名,输入application / json作为MIME类型。

鉴于此帖可在Sencha入门指南中找到,我认为值得升级步骤。

Given this post is found in the Sencha "getting started guide", I thought it's worth upgrading the steps.

在Win 7 Enterprise SP 1上使用64位
IIS具有不同的前景。所以步骤:

On Win 7 Enterprise SP 1 with 64-bit The IIS has a different outlook. So the steps:

*。打开IIS管理器。然后你会得到以下窗口。

*. Open IIS Manager. Then you get following window.

*。右键单击MIME并选择打开功能

*. Right click on MIME and choose open feature

*。点击右上角的ADD操作菜单

*. Click on ADD from top right corner Actions menu

*。休息是按照埃文的。

*. Rest is as per Evan's.

这篇关于获取IIS6以提供JSON文件(包括POST,GET)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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