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
Q

The HTTP Methods can be characterized with any combination of the following:

A

Safe
Idempotent
Cacheable

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

These do not alter the state of the server.

A

Safe Methods

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

A read-only operation.

A

Safe Methods

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

The property of certain operations such that they can be applied several times without changing the result of the initial application.

A

Idempotency

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

These methods exhibit idempotency.

A

Idempotent Methods

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

(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.

A

True

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

All safe methods are also _________.

A

idempotent

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

Only ____and ____ are cacheable.

A

HEAD, GET

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

If the method used in the request is cacheable,
then the response is considered _________.

A

cacheable

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

A 3-digit code found in the first line of HTTP response messages.

A

HTTP Status Codes

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

HTTP/1.1 200 OK

What is the Status Code?

A

200

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

_________ indicate whether a request was
successful or not (and why).

A

Status Codes

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

Each status code has a corresponding _________ or _________ that is included next to the status code.

A

reason phrase, status message

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

HTTP/1.1 200 OK

What is the Reason Phrase?

A

OK

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

The status codes can be classified into _________.

A

5 groups

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

Status Codes classification:

100-199 : _________
200-299 : _________
300-399 : _________
400-499 : _________
500-599 : _________

A

100-199 : Informational
200-299 : Success
300-399 : Redirection
400-499 : Client Error
500-599 : Server Error

41
Q

(T or F)

There are 100 codes for each group.

42
Q

_________ indicate that the client’s request was successfully received, understood, and processed.

Status Codes

43
Q

A generic success message.

Status Codes

44
Q

The request was a success and a new resource was created as a result (e.g. in response to PUT).

Status Codes

A

201 Created

45
Q

_________ codes indicate neither failure nor success.

46
Q

_________ indicate that further action needs to be taken by the client in order for the request to be processed.

A

300 range codes

47
Q

The URL requested refers to multiple resources.
This code is returned with a list of options the
client can select from.

Status Codes

A

300 Multiple Choices

48
Q

The resource has been moved to a different URL.
The new URL is indicated by the Location header in the response.

Status Codes

A

301 Moved Permanently

49
Q

Like 301, but the move is temporary. Browsers
redirect to the temporary URL but crawlers don’t
update their databases.

Status Codes

50
Q

The resource hasn’t been modified so there’s no
need to retransmit the data. Refer to a cached copy instead.

Status Codes

A

304 Not Modified

51
Q

These indicate that the server failed to process the request and that the client is the cause of the error.

Status Codes

52
Q

Usually caused by badly formed requests or nonexistent URLs.

Status Codes

53
Q

The client sent a request message with invalid syntax.

Status Codes

A

400 Bad Request

54
Q

The request was not acted upon because it lacks
valid authentication credentials.

Status Codes

A

401 Unauthorized

55
Q

The server understood the request but will not authorize it.

Status Codes

A

403 Forbidden

56
Q

Similar to 401, but logging in will make no difference. The client has no permission to access
the URL’s resource.

Status Codes

A

403 Forbidden

57
Q

There is no resource found in the specified URL.

Status Codes

A

404 Not found

58
Q

The method used in the request isn’t supported for the specified resource.

Status Codes

A

405 Method Not Allowed

59
Q

Access to the target resource is no longer available.

Status Codes

60
Q

The client sent an entity body larger than the
server can or wants to process.

Status Codes

A

413 Request Entity Too Large

61
Q

The client sent a request with a URL longer than
the server can or wants to process.

Status Codes

A

414 Request URI Too Long

62
Q

The content type of the request payload is not supported by the server.

Status Codes

A

415 Unsupported Media Type

63
Q

These indicate that the server failed to process the request and that the server was the cause of the error.

64
Q

Common causes for server error:

A

Server limitations
Error in server components
Proxy errors

65
Q

Generic server error message. The server encountered an error but can’t give a more specific status code.

Status Codes

A

500 Internal Error

66
Q

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

A

501 Not Implemented

67
Q

The server isn’t ready to handle the request.
Used for temporary conditions.

Status Codes

A

503 Service Unavailable

68
Q

503 Service Unavailable is commonly caused by _________.

A

server overload or server maintenance

69
Q

(in 503 Service Unavailable)

The server can use the _________ to
indicate how much time the client should wait
before trying again.

A

Retry-After header

70
Q

The server (acting as a proxy) couldn’t get a
response in time from the next entity.

Status Codes

A

504 Gateway Timeout

71
Q

The server doesn’t support the HTTP version used in the request message.

Status Codes

A

505 HTTP Version Not Supported

72
Q

These provide additional info about the request,
but not info about whether the request was a
success or fail.

73
Q

The client should continue with the request or
ignore the response if it’s already finished.

Status Codes

A

100 Continue

74
Q

The server is switching to the protocol requested
by the client (specified by the ‘Upgrade’ header).

Status Codes

A

101 Switching Protocols

75
Q

_________ allow the client and server to pass
additional information in request and response
messages.

76
Q

_________ and _________work together to determine what clients and servers do.

A

Headers, methods

77
Q

_________ give additional context to status codes.

78
Q

(T or F)

HTTP Headers are used by both request and response messages .

79
Q

4 Types of Headers

A

General Headers
Request Headers
Response Headers
Entity Headers

80
Q

_________ can be used for both request and response messages.

A

General Headers

81
Q

Examples of Request Headers:

A

Accept
Accept-Charset
Accept-Encoding
Accept-Language

81
Q

_________ are only used in request
messages.

A

Request headers

81
Q

They may contain info about the resource requested, or the client itself.

A

Request headers

82
Q
  • 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.
A

If-Modified-Since

82
Q

Examples of General Headers:

A

Date
Cache-Control
Connection

83
Q

Details about the browser, rendering engine, OS, architecture.

A

User-Agent

84
Q

Cookies set by the server.

85
Q

Used to give more detailed information about the response.

A

Response Headers

86
Q

How much time (in sec) the response has been in a proxy cache.

86
Q

Indicates the redirection URL. Used in
conjunction with 300 range codes.

87
Q

Details about the server’s software.

87
Q

_________ describe the content of the message body.

A

Entity Header

87
Q

Entity Header can contain information about the payload such as:

A

●Content length
● Language
● Encoding
● Location
● Type
● Date of last modification

88
Q

(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.

89
Q

The value of the Content-Type header indicates the _________ of the payload content.

90
Q

Sample MIME Types:

A

❏ text/css
❏ text/html
❏ application/zip
❏ application/powerpoint
❏ application/pdf

90
Q

(T or F)

HTTP is meant to be extensible.

90
Q

_________ help the receiving entity decide what to do with the data.

91
Q

(T or F)

Developers can make up their own headers, status codes, or methods.

A

True
(though this might cause
interoperability issues)