什么是REST?
http://restful.p2hp.com
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
面向 Web 开发者的文档
https://developer.mozilla.org/zh-CN/docs/Web
Set-Cookie
https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Set-Cookie
nginx中http_host和$proxy_host区别
https://blog.csdn.net/yihanzhi/article/details/107002881
HTTP状态204 (No Content)
http://restful.p2hp.com/resources/http-status-codes/http-status-204-no-content
解决跨域:
location ^~ /doc {
proxy_pass http://upsdoc;
}
location ^~ /doc/file/downloadfile {
proxy_pass http://upsdoc;
}
location ^~ /doc/file/uploadfile {
if ($request_method = "OPTIONS") {
return 204;
add_header 'Access-Control-Allow-Origin' '$http_origin';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS';
add_header 'Access-Control-Allow-Headers' 'pubacc-buid,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,Accept,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,*';
add_header 'Access-Control-Max-Age' '3600';
}
if ($request_method = "GET") {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'pubacc-buid,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,Accept,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,*';
}
if ($request_method = "POST") {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS';
add_header 'Access-Control-Allow-Headers' 'pubacc-buid,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,Accept,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,*';
}
proxy_pass http://upsdoc;
}
网友评论