I have an asp.net 4.0 web site that needs to serve files of type .json. The request is coming in as a POST, which does not work. GET works fine. Anyone know what configuration I need to change to make this work?
You probably already found the answer, but I think the problem lies in that you need to add a ".json" handler for your web server...
By default IIS is not configured to handle .json extension.
You can apply the mime type as a handler on the root of IIS so .json can be handled by every site or virtual folder in the IIS or just to the specific site.
( or Apache, if you're on the dev side... )
Apache Module mod_mime AddType
Note: In Ubuntu you ALSO need to edit the file /etc/mime.types and add the line:
application/json json
Then restart Apache
sudo /etc/init.d/apache2 restart
GET or POST is irrelevant, its got nothing to do with the type of response your program sends. There is no setting that would make a difference. Your problem is a logic error in your program.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.