IIS6.0
1. Open IIS Add MIME entry
Association extension: *.json
content Type (MIME):application/x-javascript
2. Add Mappings:
Location in IIS corresponding site right-key properties: "Home Directory"-"Application Settings"-"Configuration"-"mapping"-"Add" opens "Add/Edit Application extension mappings"
Name extension: . JSON
Run File:C:\WINDOWS\system32\inetsrv\asp.dll
action:get,post
iis7.x IIS8
1, in "MIME type" "Add" a file name extension is ". Json", MIME type is Text/json (also can be application/x-javascript)
2, and then "Add script Map" in "handler mapping", the request path is: *.json, executable file is C:/windows/system32/inetsrv/asp.dll.
If Asp.dll is not found, go to Control Panel--> program--> turn on and off Windows features--->internet Information services---> World Wide Web Services--> application development features, open ASP support. Open it immediately and you can find the Asp.dll file.
Content Type (MIME): Text/json
Then we access through the browser: Http://localhost/xxx.json, you should be able to display JSON data, if the download prompts, check the above steps if there is a spelling error, if not, restart the computer, should be OK.
Add:
The small series then flipped through some data and found that in 2006 JSON had registered a MIME type of Application/json
So the above MIME type, everyone changed to Application/json
Attached information:
RFC 4627 "The Application/json Media type for JavaScript Object notation (JSON)" registered JSON as a MIME type in July 2006: application/ Json.
See:
ECMA-404 the JSON Data interchange Format
RFC 4627-the Application/json Media Type for JavaScript Object notation (JSON)
Json:http://json.org/json-zh.html
Mime:http://www.iana.org/assignments/media-types/media-types.xhtml
Application/json:http://www.iana.org/assignments/media-types/application/json