HTTP (methods, status code, & headers) Flashcards

1
Q

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

Indicates the desired action for the specified resource.

A

Method

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

HTTP 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
4
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
5
Q

Method meant to be read only, and not modify the server’s state.

A

GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
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
7
Q

Acording to W3C, POST is designed to cover 4 functions:

A
  • annotation of existing resources
  • posting a message to board
  • providing a block of data
  • extending a database through an append operation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Unlike GET, 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
9
Q

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

A

HEAD

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
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
11
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
12
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
13
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
14
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
15
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
16
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
17
Q

Can be used to ask what methods are supported by the server in total or what methods are supported for specific resources in the server.

A

OPTIONS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
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
19
Q

HTTP Methods that correspond to CRUD operations.

A

PUT
GET
POST/PATCH
DELETE

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

To ensure compatibility between servers and their clients, all parties are expected to ____________________.

A

stick to the defined conventions.

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

What are the three characteristics of HTTP Methods.

A

Safe
Idempotent
Cacheable

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

Methods that do not alter the state of the server. In other words, a read-only operation.

A

Safe Methods

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

These methods when applied several times do not change the result of the initial application.

A

Idempotent

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

Methods that leave the server in the same state whether the request was done once or repeated several times.

A

Idempotent

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

All ______ methods are also idempotent since they don’t change the server’s state.

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

If this methods is used in the request, the response is considered cacheable.

A

Cacheable

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

Only ____ and _____ methods are cacheable.

A

HEAD and GET

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

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

A

HTTP Status Code

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

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

A

Status Code

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

Each status code has a corresponding ______ or ________ that it included next to the status code.

A

Reason Phrase or Status Message

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

Status codes can be classified into 5 groups, what are they?

A

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

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

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

A

200 range - success

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

The request has succeeded. The meaning varies depending on the HTTP Method of the request.

A

200 - OK

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

The request was a success and a new resource was a created as a result

A

201 - Created

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

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

A

300 range

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

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

A

300 Multiple Choices

37
Q

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

A

301 Moved Permanently

38
Q

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

39
Q

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

A

304 Not Modified

40
Q

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

A

400 - error

41
Q

These are usually caused by badly formed requests or nonexistent URLs

A

400 - error

42
Q

The client sent a request message with invalid syntax.

A

400 - Bad Request

43
Q

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

A

401 Unauthorized

44
Q

The server understood the request but will not authorize it

A

403 - Forbidden

45
Q

There is no resource found in the specified URL

A

404 Not Found

46
Q

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

A

405 - Method Not Allowed

47
Q

Access to the target resource is no longer available

A

410 - Gone

48
Q

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

A

413 Request Entity Too Large

48
Q

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

A

414 Request URI Too Long

48
Q

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

A

415 Unsupported Media Type

48
Q

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

A

500 - server errors

49
Q

Common causes: server limitations, error in server components, proxy errors.

A

500 - server errors

49
Q

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

A

500 Internal Error

50
Q

The server does not support the functionality to fulfill the request.

A

501 Not Implemented

50
Q

The server does not recognize the request method at all.

A

501 Not Implemented

50
Q

The server isn’t ready to handle the request. Commonly request by server overload or server maintenance.

A

503 Service Unavailable

51
Q

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

A

503 Service Unavailable

51
Q

The server couldn’t get response in time from the next entity.

A

504 Gateway Timeout

51
Q

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

A

505 HTTP Version Not Supported

51
Q

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

A

100 - Informational

51
Q

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

A

100 Continue

51
Q

The server is switching protocols requested by the client.

A

101 Switching Protocols.

52
Q

This header specify to switch to the protocol requested by the client.

A

Upgrade Header

52
Q

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

53
Q

Work together to determine what clients and servers do.

A

Headers and Methods

54
Q

Give additional context to status codes.

54
Q

Used by both request and response messages.

A

HTTP Headers

54
Q

4 types of Headers

A

General Headers
Request Headers
Response Headers
Entity Headers

55
Q

Can be used for both request and response messages.

A

General Headers

55
Q

They contain general information that does not apply to the contents of the message body.

A

General headers+

55
Q

Examples of General Headers

A

Date, Cache-Control, Conenction

55
Q

Used only in request messages.

A

Request Headers

55
Q

May contain info about the resource requested, or the client itself.

A

Request Headers

55
Q

Examples of Request Headers

A

Accept
Accept-Charset
Accept-Encoding
Accept-Language

56
Q

Request header where client request a new copy of the resource if it has been modified since the specified date.

A

If-Modified-Since

56
Q

Details about the browser, rendering engine, PS. architecture

A

User-Agent

57
Q

Cookies set by the server

57
Q

Used to give more detailed information about the response

A

Response Headers

57
Q

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

57
Q

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

57
Q

Details about the server’s software

57
Q

Can be used by both request and response messages.

A

Entity Header

57
Q

The only header to describe the content of the message body

A

Entity Header

58
Q

Contain information about the payload such as:

A

Content Length
Language
Encoding
Type
Location
Date of last modification

58
Q

Can be used by clients and servers to negotiate what kind of resource is sent between them.

A

Conditional Request Headers and entity headers.

58
Q

Value of the content-type header indicates the ___________ of the payload content.

58
Q

Helps the receiving entity decide what to do with the data.

A

Multipurpose Internet Mail Extension

58
Q

Sample MIME Types

A

Text/css
Text/html
application/zip
application/powerpoint
application/pdf

58
Q

HTTP is meant to be ________. Developers can make up their own headers, status codes, or methods. Though this might cause interoperability issues.

A

Extensible