HTTP Methods, Status Codes, & Headers Flashcards

1
Q

_________ are used by HTTP request messages in the request line.

A

Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

GET /home HTTP/1.1

What is the method?

A

GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

_________ indicates the desired action for the specified resource.

A

Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

GET /home HTTP/1.1

What is the “action”?

A

GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

GET /home HTTP/1.1

What is the resource path?

A

/home

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Methods are sometimes called _________ because of the verb-like naming scheme.

A

HTTP Verbs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Used to request a specific resource from the server.

A

GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

GET requests are meant to be _________, and not modify the server’s state.

A

read only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Used to submit data to a server.

A

POST

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

POST is designed to cover the 4 functions:

A

1) Annotation of existing resources
2) Posting a message to a bulletin board,
newsgroup, mailing list, etc.
3) Providing a block of data, such as the result
of submitting a form, to a data-handling
process
4) Extending a database through an append operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The actual behavior of a server in response to a POST request depends on the _________.

A

server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

POST requests often result in some
_________ in the server

A

State change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Used for checking link validity, recent modification, or just to find out more about the resource without actually fetching it.

A

HEAD

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The expected response of a HEAD request is identical to a response to a GET request with the same path, headers, etc. but without the _________.

A

response body

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Replaces current resource in the specified path with the data in the request body.

A

PUT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Deletes the resource in the specified path.

A

DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Used by the client to establish a connection to the server over a tunnel proxy.

A

CONNECT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Used to echo the contents of an HTTP Request back to the client.

A

TRACE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Useful for checking how the request is modified by proxies on its way to the server.

A

TRACE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Generally for debugging.

A

TRACE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Used to ask the server about its supported methods.

A

OPTIONS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

_________ can be used to ask what methods are supported by the server in total.

A

OPTIONS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Used to apply partial modification to the data in the specified URL.

A

PATCH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

(T or F)

Some methods correspond to the CRUD operations.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
The HTTP Methods can be characterized with any combination of the following:
Safe Idempotent Cacheable
26
These do not alter the state of the server.
Safe Methods
27
A read-only operation.
Safe Methods
28
The property of certain operations such that they can be applied several times without changing the result of the initial application.
Idempotency
29
These methods exhibit idempotency.
Idempotent Methods
30
# (T or F) An HTTP request with an idempotent method leaves the server in the same state whether the request was done once or repeated several times.
True
31
All safe methods are also _________.
idempotent
32
Only ____and ____ are cacheable.
HEAD, GET
33
If the method used in the request is cacheable, then the response is considered _________.
cacheable
34
A 3-digit code found in the first line of HTTP response messages.
HTTP Status Codes
35
HTTP/1.1 200 OK What is the Status Code?
200
36
_________ indicate whether a request was successful or not (and why).
Status Codes
37
Each status code has a corresponding _________ or _________ that is included next to the status code.
reason phrase, status message
38
HTTP/1.1 200 OK What is the Reason Phrase?
OK
39
The status codes can be classified into _________.
5 groups
40
Status Codes classification: 100-199 : _________ 200-299 : _________ 300-399 : _________ 400-499 : _________ 500-599 : _________
100-199 : Informational 200-299 : Success 300-399 : Redirection 400-499 : Client Error 500-599 : Server Error
41
# (T or F) There are 100 codes for each group.
False
42
_________ indicate that the client’s request was successfully received, understood, and processed. | Status Codes
200 range
43
A generic success message. | Status Codes
200 OK
44
The request was a success and a new resource was created as a result (e.g. in response to PUT). | Status Codes
201 Created
45
_________ codes indicate neither failure nor success.
300 range
46
_________ indicate that further action needs to be taken by the client in order for the request to be processed.
300 range codes
47
The URL requested refers to multiple resources. This code is returned with a list of options the client can select from. | Status Codes
300 Multiple Choices
48
The resource has been moved to a different URL. The new URL is indicated by the **Location** header in the response. | Status Codes
301 Moved Permanently
49
Like 301, but the move is temporary. Browsers redirect to the temporary URL but crawlers don’t update their databases. | Status Codes
302 Found
50
The resource hasn’t been modified so there’s no need to retransmit the data. Refer to a cached copy instead. | Status Codes
304 Not Modified
51
These indicate that the server failed to process the request and that **the client is the cause of the error**. | Status Codes
400 range
52
Usually caused by badly formed requests or nonexistent URLs. | Status Codes
400 range
53
The client sent a request message with invalid syntax. | Status Codes
400 Bad Request
54
The request was not acted upon because it lacks valid authentication credentials. | Status Codes
401 Unauthorized
55
The server understood the request but will not authorize it. | Status Codes
403 Forbidden
56
Similar to 401, but logging in will make no difference. The client has no permission to access the URL’s resource. | Status Codes
403 Forbidden
57
There is no resource found in the specified URL. | Status Codes
404 Not found
58
The method used in the request isn’t supported for the specified resource. | Status Codes
405 Method Not Allowed
59
Access to the target resource is no longer available. | Status Codes
410 Gone
60
The client sent an entity body larger than the server can or wants to process. | Status Codes
413 Request Entity Too Large
61
The client sent a request with a URL longer than the server can or wants to process. | Status Codes
414 Request URI Too Long
62
The content type of the request payload is not supported by the server. | Status Codes
415 Unsupported Media Type
63
These indicate that the server failed to process the request and that the server was the cause of the error.
500 range
64
Common causes for server error:
Server limitations Error in server components Proxy errors
65
Generic server error message. The server encountered an error but can’t give a more specific status code. | Status Codes
500 Internal Error
66
The server does not support the functionality to fulfill the request.Use case: The server doesn’t recognize the request method at all. | Status Codes
501 Not Implemented
67
The server isn’t ready to handle the request. Used for temporary conditions. | Status Codes
503 Service Unavailable
68
503 Service Unavailable is commonly caused by _________.
server overload or server maintenance
69
(in 503 Service Unavailable) The server can use the _________ to indicate how much time the client should wait before trying again.
Retry-After header
70
The server (acting as a proxy) couldn't get a response in time from the next entity. | Status Codes
504 Gateway Timeout
71
The server doesn’t support the HTTP version used in the request message. | Status Codes
505 HTTP Version Not Supported
72
These provide additional info about the request, but not info about whether the request was a success or fail.
100 range
73
The client should continue with the request or ignore the response if it’s already finished. | Status Codes
100 Continue
74
The server is switching to the protocol requested by the client (specified by the ‘Upgrade’ header). | Status Codes
101 Switching Protocols
75
_________ allow the client and server to pass additional information in request and response messages.
Headers
76
_________ and _________work together to determine what clients and servers do.
Headers, methods
77
_________ give additional context to status codes.
Headers
78
# (T or F) HTTP Headers are used by both request and response messages .
True
79
4 Types of Headers
General Headers Request Headers Response Headers Entity Headers
80
_________ can be used for both request and response messages.
General Headers
81
Examples of Request Headers:
Accept Accept-Charset Accept-Encoding Accept-Language
81
_________ are only used in request messages.
Request headers
81
They may contain info about the resource requested, or the client itself.
Request headers
82
* Client requests a new copy of the resource if it has been modified since the specified date. * If the resource hasn’t been modified, client receives 304 and uses a cached copy instead.
If-Modified-Since
82
Examples of General Headers:
Date Cache-Control Connection
83
Details about the browser, rendering engine, OS, architecture.
User-Agent
84
Cookies set by the server.
Cookie
85
Used to give more detailed information about the response.
Response Headers
86
How much time (in sec) the response has been in a proxy cache.
Age
86
Indicates the redirection URL. Used in conjunction with 300 range codes.
Location
87
Details about the server’s software.
Server
87
_________ describe the content of the message body.
Entity Header
87
Entity Header can contain information about the payload such as:
●Content length ● Language ● Encoding ● Location ● Type ● Date of last modification
88
# (T or F) Conditional request headers and entity headers can be used by clients and servers to negotiate what kind of resource is sent between them.
True
89
The value of the Content-Type header indicates the _________ of the payload content.
MIME Type
90
Sample MIME Types:
❏ text/css ❏ text/html ❏ application/zip ❏ application/powerpoint ❏ application/pdf
90
# (T or F) HTTP is meant to be extensible.
True
90
_________ help the receiving entity decide what to do with the data.
MIME Type
91
# (T or F) Developers can make up their own headers, status codes, or methods.
True (though this might cause interoperability issues)