Web Application Technologies Flashcards
1
Q
HTTP Requests
A
- consist of one or more headers, each on a separate line
- followed by a mandatory blank line
- followed by an optional message body
2
Q
The first line of every HTTP request consists of WHAT three items, separated by spaces?
A
- A VERB indicating the HTTP method (i.e. GET, POST)
- The requested URL and option query string (params)
- HTTP version being used (HTTP/1.1)
3
Q
The Requested URL?
A
- The URL typically functions as a name for the resource being requested, together with an optional query string containing parameters that the client is passing to that resource
- The query string is indicated by the ‘?’ character in the URL
EXAMPLE: /auth/488/page.aspx?uid=129
4
Q
What are some common HTTP Request Headers?
A
- Referer
- User-Agent
- Host
- Cookie
5
Q
Referer Header
A
- used to indicate the URL from which the request originated
- EXAMPLE: If the user clicked on a link, the link URL is displayed
6
Q
User-Agent Header
A
- used to provide information about the browser or other client software that generated the request.
7
Q
Host Header
A
- specifies the hostname that appeared in the full URL being accessed
- this is necessary when multiple websites are being hosted on the same server
8
Q
Cookie Header
A
- used to submit additional parameters that the server has issued to the client
- EXAMPLE: SessionId=5B70C71F3FD4963829483484
9
Q
The first line of the HTTP Response consists of WHAT three items?
A
- The HTTP version being used
- A numeric status code indicating the result of the request (200 is most common)
- A textual “reason phrase” further describing the status of the response (usually ‘OK’); not really used anymore
10
Q
GET method
A
- most common
- designed to retrieve resources
- it can be used to send parameters to the requested resource in the URL query string
11
Q
POST method
A
- used to perform actions
- with this method, request parameters can be sent both in the URL query string and in the body of the message
12
Q
General HTTP Headers
A
- Connection
- Content-Encoding
- Content-Length
- Content-Type
- Transfer-Encoding
13
Q
Connection Header
A
- tells the other end of the communication whether it should close the TCP connection after the HTTP transmission has completed, or keep it open for further messages
14
Q
Content-Encoding Header
A
- specifies the type of encoding being used for the content contained in the message body
- EXAMPLE: gzip
15
Q
Content-Type Header
A
- specifies the type of content contained in the message body, such as ‘text/html’ for HTML documents