http methods & restful api methods
http methods & restful api methods
超文本传输协议(HTTP)是用于传输超媒体文档(例如HTML)的
应用层
协议
https://developer.mozilla.org/en-US/docs/Web/HTTP
https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
HTTP Methods (9 种)
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
CONNECT & TRACE
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE
HTTP Request Methods (7 种)
GET
POST
PUT
PATCH
DELETE
HEAD
OPTIONS
RESTful API
https://www.restapitutorial.com/lessons/httpmethods.html
REST Principles and Architectural Constraints
https://restfulapi.net/rest-architectural-constraints/
-
Uniform interface
-
Client–server
-
Stateless
-
Cacheable
-
Layered system
-
Code on demand (optional)
统一的界面
客户端服务器
无状态
可缓存的
分层系统
按需代码(可选)
Fetch API & OPTIONS
CORS 预检请求
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Preflighted_requests
CORS 简单请求
refs
https://restful-api-design.readthedocs.io/en/latest/methods.html
https://restfulapi.net/http-methods/
CORS 原理
- white list
HTTP status code
100 Continue
101 Switching Protocols
103 Early Hints
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
307 Temporary Redirect
308 Permanent Redirect
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Payload Too Large
414 URI Too Long
415 Unsupported Media Type
416 Range Not Satisfiable
417 Expectation Failed
418 I'm a teapot
422 Unprocessable Entity
425 Too Early
426 Upgrade Required
428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
451 Unavailable For Legal Reasons
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
506 Variant Also Negotiates
507 Insufficient Storage
508 Loop Detected
510 Not Extended
511 Network Authentication Required
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13214562.html
未经授权禁止转载,违者必究!