HTTP (Method, Status Codes, and Headers) Flashcards
These are used by HTTP request messages in the request line. It indicates the desired action for the specified resource.
Method
Methods are sometime called as?
HTTP Verbs
This method is used to request a specific resource from the server. These request are meant to be read only, and not modify the server’s state.
Get Method
This method is used to submit data to a server.
It serves four function:
- Annotation of existing resources
- Posting a message to a bulletin board, newsgroup, mailing list, etc
- Providing a block of data, such as the result of submitting a form, to a data-handling process.
- Extending a database through an append operation
Unlike GET, it often results in some state change in the server.
POST
The expected response of this method is identical to a response to a Get request with the same path, headers, etc. but without the response body. It is used for checking link validity, recent modification, or just to find out more about the resource without actually fetching it.
HEAD
This method replaces a current resource in the specified path with the data in the request body.
PUT
This method deletes the resource in the specified path.
DELETE
This method is used by the client to establish a connection to the server over a tunnel proxy
CONNECT
This method is used to echo the contents of an HTTP Request back to the client. It is generally for debugging.
TRACE
This method is used to ask the server about its supported methods. It can be used to ask what methods are supported by the server in total.
OPTIONS
This method is used to apply partial modification to the data in the specified url
PATCH
One characteristic of an HTTP method is through? These do not alter the state of the server. (read only operation)
Safe Methods
One characteristic of an HTTP method is through? These method exhibit Idempotency
Idempotent Methods
This property of certain operations such that they can be applied several times without changing the result of the initial application.
Idempotency
True or False? All safe methods are no idempotents since they change the server’s state
False
In this method, only head and get are cacheable. If the method used in the request is cacheable, then the response is considered cacheable.
Cacheable Methods.
200 OK
MEANING IN GET, HEAD, AND DELETE?
GET: The resource was fetched and is in the response body.
HEAD: The entity headers are in the response
DELETE: The resource at the specified URL was deleted.
201 Created
What is the meaning?
The request was a success and a new resource was treated as a result (e.g. in response to PUT)
What range in status code indicate neither failure nor success. It indicates that further action needs to be taken by the client in order for the request to be processed. A common cause is the need for clients to use alternate locations for their requested resource
300 Range
What does 300 Multiple Choices mean?
The URL requested refers to multiple resources. This code is returned with a list of options the client can select from.
301 moved permanently means?
The resource has been moved to a different URL. The new URL is indicated by the location header in the response.
302 found means?
It is like 301, but the move is temporary. Browsers redirect to the temporary URL but crawlers don’t update their databases
304 Not modified means?
The resources hasn’t been modified so there’s no need to transmit the data. refer to a cached copy instead
what usually causes 400 range?
Caused by badly formed requests or nonexistent URLs.
When the syntax is invalid what is returned?
400 Bad Request
When the request was not acted upon becuase it lacks valid authentication credential it send what status code?
401 Unauthorized
When the server understood the request but will not authorize it, what status code will be sent?
403 Forbidden
When there is no resource found in the specified URL what status code is given?
404 Not found
When the method used in the request isn’t supported for the specified resource, what status code is given?
405 Method not allowed
When the access to the target resource is no longer available, what status code is given?
410 Gone
When the client sent an entity body larger than the server can or wants to process, what status code is given?
413 Request Entity Too Large
When the client sent a request with a URL longer than the server can or wants to process, what status code is given?
414 Request URI Too Long
When the content type of the request payload is not supported by the server, what status code is given?
415 Unsupported Media Type
What is the common cases for 500 range status code to show?
Server limitations, error in server components, proxy errors.
When the server encountered an error but can’t give a more specific status code, what status code is given? It is a generic server error message.
500 Internal Error
When the server does not support the functionality to fulfill the request. Use Case: the server doesn’t recognize the request method at all.
501 Not Implemented
When the server isn’t ready to handle the request. It is commonly caused by server overload or server maintenance. Used for temporary conditions
503 Service Unavailable
What can the server use to indicate how much time the client should wait before trying again in 503 service unavailable?
Retry After header
When the server, acting as a proxy, couldn’t get a response in time from the next entity, what status code is shown?
504 Gateway Timeout
When the server doesn’t support the HTTP version used in the request message, what status code is given?
505 HTTP Version Not Supported.
In a 101 switching protocol, when the server is switching to the protocol requested by the client, it is specified by what header?
Upgrade
When the client should continue with the request or ignore the response if it’s already finished, what status code should be given?
100 Continue
This allow the client and server to pass additional information in request and response message. It work with methods to determine what clients and servers do. It also gives additional context to status codes.
Header
Who uses HTTP headers?
request and response messages
This type of header can be used for both request and response messages. They contain general information that does not apply to the contents of the message body.
General Header
This type of header are only used in request messages. They also don’t relay to contents of the request message body. They may contain the resource requested, or the client itself
Request Header
Here, clients requests a new copy of the resource if it has been modified since the specified date. If the resources hasn’t been modified, client receives 304 and uses a cached copy instead.
If-modified-Since
This type of header us used to give more detailed information about the response. They don’t relate to the message body content either.
Respond Header
This refers how much time (in seconds) the response has been in a proxy cache
Age
This indicates the redirection URL. It is used in conjunction with 300 range codes.
Location
This type of header can be used by both request and response messages. They describe the content of the message body
Entity Header
The value of the Content-Type header indicates what of the payload content?
MIME Type
The multipurpose internet mail extension or Mime helps in?
the receiving entity decide what to do with the data.
In the MIME type, what is for design/layout?
text/css
in the mime type, what is for rendering the doc as HTML
text/html
in the mime type what is used to open a download prompt?
application/zip
in the mime type what are used to display as a document?
application/powerpoint
application/pdf
Is HTTP meant to be extensible?
Yes