Module 5 Flashcards
Describe the format of a HTTP message?
- Start Line
- Headers
- [empty line]
- Body [optional]
True or False?: The terms HTTP verbs and HTTP methods mean the same thing.
True.
What the Start Line in a HTTP message does?
Describe the message.
What the Headers contain in a HTTP message do?
The attributes.
What the [empty line] in a HTTP message does?
Separates the Headers from the Body.
What the Body in a HTTP message does?
It’s optional. It’s used to include data with the message.
What is the first questions a HTTP Request Message needs to answer?
What resources is this request concerned with?
What is the second questions a HTTP Request Message needs to answer?
What do you want to do with that resource?
What is the third questions a HTTP Request Message needs to answer?
How do you want to modify this request from the default, if at all?
What are is the fourth questions a HTTP Request Message needs to answer?
Is there additional data you’d like to send along with this request that wil be needed to complete the request and generate a response? (additional data is data that the server will need in order to do its job.)
What are HTTP verbs?
A command given to the server through the request.
GET /index.html HTTP/1.1
Host: www.exampleschool.com
Accept-Language: en-us
In the above HTTP request message, what is the first section?
It’s the Stat Line, which is used to describe the message. It’s using the HTTP method “GET” from version 1.1 of the HTTP specification. The aim of the GET method is the resource inndex.html.
GET /index.html HTTP/1.1
Host: www.exampleschool.com
Accept-Language: en-us
In the above HTTP request message, what is the second section?
It’s the Header Line, which contain modifiers for the message. In this case there are two headers: “HOST”, which specifies the domain where the resource will be found, and “Accept-Language”, which specifies what language the requesting browser will accept in the response.
GET /index.html HTTP/1.1
Host: www.exampleschool.com
Accept-Language: en-us
In the above HTTP request message, what is the third section?
A blank line, meaning the Header item is complete. There is no body.
What is this ?firstName=Harry&lastName=Potter?
A Query String. The “?” starts the Query String and the “&” separates the key/value pairs.
GET /adminportal/get_student?studentId=23
Host: www.exampleschool.com
Accept-Language: en-us
Explain the first section of this HTTP Request message.
The method GET is requesting the get_student method to retrive data with the Query String ?studentId=23.