HTTP Flashcards
What is GET request?
GET is used to request data from a specified resource.
What is POST request?
POST is used to send data to a server to create/update a resource.
What is PUT request?
PUT is used to send data to a server to create/update a resource.
What is DELETE request?
The DELETE method deletes the specified resource.
What is HEAD request?
The HEAD method is used to ask only for information about a document, not for the document itself.( return metadata) HEAD is much faster than GET.
What is PATCH request?
The HTTP methods PATCH can be used to update partial resources. For instance, when you only need to update one field of the resource.
What is the main difference between PUT and PATCH?
PUT and PATCH are HTTP verbs and they both relate to updating a resource.
- PUT to a URL creates/replaces the resource in its entirety at the client defined URL
- PATCH to a URL updates part of the resource at that client defined URL.
For put request we need to send all fields to update even if we don’t need to update everything, for PUTCH we can send only one fieds.
{ “first”: “Michael”, “last”: “Angelo” }
What kinds of http statuses do you know? (5)
- 1xx: Information
- 2xx: Successful
- 3xx: Redirection
- 4xx: Client Error
- 5xx: Server Error
What is 200 code?
OK - The request is OK (this is the standard response for successful HTTP requests)
What is 201 code?
Created - The request has been fulfilled, and a new resource is created
What is 301 code?
Moved Permanently - The requested page has moved to a new URL
What is 400 code?
Bad Request - The request cannot be fulfilled due to bad syntax
What is 401 code?
Unauthorized - The request was a legal request, but the server is refusing to respond to it. For use when authentication is possible but has failed or not yet been provided
What is 403 code?
Forbidden - The request was a legal request, but the server is refusing to respond to it
What is 404 code?
Not Found - The requested page could not be found but may be available again in the future