xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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/

  1. Uniform interface

  2. Client–server

  3. Stateless

  4. Cacheable

  5. Layered system

  6. 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 原理

  1. 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 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-06-30 16:39  xgqfrms  阅读(254)  评论(2编辑  收藏  举报