-
Notifications
You must be signed in to change notification settings - Fork 7
HTTP and REST
all1124 edited this page Oct 14, 2019
·
2 revisions
- Hypertext Transfer Protocol
- A stateless, application-layer protocol for communicating between distributed systems
- The foundation of the modern web
- Allows for communication between a variety of hosts and clients, and supports a mixture of network configurations
- To make this possible, it assumes very little about a particular system, and does not keep state between different message exchanges
- Communication between a host and a client occurs, via a request/response pair
- The client initiates an HTTP request message, which is serviced through a HTTP response message in return
- The request message are sent via Uniform Resource Locators (URLs)
- These request verbs are:
- GET: fetch an existing resource
- POST: create a new resource
- POST requests usually carry a payload that specifies the data for the new resource.
- PUT: update an existing resource
- The payload may contain the updated data for the resource.
- DELETE: delete an existing resource
- In return, the server responds with status codes and message payloads
- 1xx: Informational Messages
- 2xx: Successful
- 3xx: Redirection
- The most common use-case is to jump to a different URL in order to fetch the resource
- 4xx: Client Error
- 5xx: Server Error
Additional Resources: