In doing an interface, return the JSON file, do the test in order to conveniently open the browsing directly on the Web page.
The JSON file is downloaded automatically when you open it now. Then Baidu a bit, to arrive at the solution:
The workaround is also very simple and requires that we add MIME type support for JSON in the operating system's registry.
You can edit the following into a file with the extension *.reg (the file name is arbitrary), and then double-click Execute to import the file into the registry:
Windows Registry Editor Version 5.00[hkey_classes_root\mime\database\content Type\application/json] "CLSID" = "{ 25336920-03F9-11CF-8FD0-00AA00686F13} "" Encoding "=dword:00080000[hkey_classes_root\mime\database\content Type\ Text/json] "CLSID" = "{25336920-03f9-11cf-8fd0-00aa00686f13}" "Encoding" =dword:00080000
The principle is to modify the registry, the Application/json, Text/json two content-type open settings to the same as gif/png/html, instead of directly open view with the browser.
After importing the above registry file, the JSON can be displayed without downloading it by using the browser to open it. (away)
Let the browser open the JSON file directly display