HTTP Flashcards

1
Q

What is HTTP and what is its use?

A

Hypertext Transfer Protocol
- Describes how a program called the client can send a request (e.g., retrieve a document) to
- Another program called the server which sends back a response (e.g., containing the requested document) back to the client

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

What is a URL and what is its use

A

Uniform Resource Locator (URL) is a type of URI (Uniform Resource Identifier).
- Identifies the location of a resource
- Contains some required and some optional parts
- A naming infrastructure to represent documents, or more formally resources, located on the web. We commonly call a URL a web address.

  • Typically the client and server programs run on different machines. In such cases, the url identifies both the machine on which the server is running as well as the specific document among all the other documents hosted by that server. The URL naming infrastructure thus allows retrieval of documents that are located across geographically distant places, i.e., across a wide area.

scheme://server-name:port-number/path-to-resource?param1=value1&param2=value2#link-in-resource

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

What is HTML and what is its use

A

Hypertext Markup Language - A markup language for describing documents that can be retrieved over the web.
- The term hypertext means text which contains links to other texts
HTML supports describing hypermedia documents, i.e., documents that besides text, can also contain other media such as graphics, video, and sound
- A client interprets the HTML in a document it receives in the HTTP response from the server and displays the document.

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

What is Javascript and what is its use?

A

A programming language which can be executed by web browsers, and is also used as a general purpose programming language. It is also very popular for implementing server side programs.
- it was developed in order to allow running programs in the browser to support full-blown applications with rich user interfaces and good performance that did not require round-trip communication to the server for every user interaction.

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

What is CSS and what is its use?

A

Developed as a way to provide developers a way to have more control over the look and feel of their webpages. Also allows for displaying webpages differently based on screen differences.
- Allows for separating the styling aspects of a webpage, e.g., colors, fonts, etc., from its structure.
- Used for describing the presentation of documents on the web while HTML continues to be used for describing the structure of documents.

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

What is a server

A

A server receives the HTTP request from a client and determines the document that has been requested.

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

What is a client

A

A client is a web browser.
A client on the web communicates with the server using HTTP protocol.

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

How do a client and a server communicate over the web

A

A user enters a URL in the browser (client)
- The browser sends an HTTP request to the appropriate web server as identified by the URL
- The server receives the HTTP request and determines the document that has been requested
- The server sends back the document in an HTTP response to the browser
- The browser interprets the HTML document and displays its contents.

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

What are the different parts of an HTTP request

A

An HTTP request has up to 4 parts.
1. The request line, the first line which has the following format: Request-Method Resource HTTP/Version
2. Request Headers: these take the form of a name:value pair
3. A blank line
4. An optional body, usually empty for a Get request, but contains the content in a POST request

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

What is in a request line?

A

Request-Method Resource HTTP/Version

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

What is the GET method used for?

A

The GET method is used to retrieve a document

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

What is the use of request headers?

A

Used to pass additional information to the server.

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

What re the different parts of an HTTP response

A

Status Line
Response Headers
Blank Line
Optional Body

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

What is in the status line?

A

HTTP/Version Status-code Reason-phrase

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

What is the use of response code?

A

This code provides the status of the response.
200 - successful request
400 - the request failed because of a client error
500 - the request failed because of a server error

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

What is the use of response headers?

A

These take the form of name:value pairs
Almost all responses contain at least a Date and Content-Type header
- The content-type header tells the browser the format of the resource sent in the body of the response
-

17
Q

What may be contained in a response body?

A

Contains the resource.

18
Q

What is a scheme?

A

This identifies the protocol used to send the request. HTTP, HTTPS

19
Q

What are the server name and port?

A

The name of the machine where the resource is hosted and to which the request must be sent

The endpoint to which data is routed.

20
Q

How does a URL specify which resource it wants from the server?

A

The path to the resource is included in the url as the fourth parameter

21
Q

What is the use of query parameters?

A

These are optional key-value pairs separated by & and they are used to provide additional information to the program to be executed for processing the request

22
Q
A