Today to do the network request data when encountered return code 405, then silly ~ ~
The story is this--I use a POST request to access a URL, the server data is a JSON TXT file, the theoretical direct access, return JSON, and then parse it all right, but today is very silent. Actually return to me 405 ...
Asked a lot of people, they gave me a variety of ideas, are not effective. Finally listen to a good friend asked me to try to change GET request, oops ~ ~ ~ this solved ...
I asked him why. Probably back to is, I visit with a POST request, then, when the URL is sent to a specific resource, the site should be resolved when the entire URL as the domain name resolution. That is, I do not pass parameters to the server, but directly to the server-side specific resources, so use GET request.
Original address: http://blog.csdn.net/qq505525372/article/details/8461209
Nginx Solution:
#添加以下405代码
Error_page 405 =200 $uri;
Location ~ ^/(JSON)/{
Root/data/website/xxxx.com/js/json;
Error_page 405 =200 $uri;
}
Ps:
http://www.oschina.net/question/136723_44914
http://blog.csdn.net/sunbiao0526/article/details/8634787
One of the HTTP return code 405 solutions