Module 5 Flashcards

1
Q

Describe the format of a HTTP message?

A
  1. Start Line
  2. Headers
  3. [empty line]
  4. Body [optional]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False?: The terms HTTP verbs and HTTP methods mean the same thing.

A

True.

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

What the Start Line in a HTTP message does?

A

Describe the message.

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

What the Headers contain in a HTTP message do?

A

The attributes.

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

What the [empty line] in a HTTP message does?

A

Separates the Headers from the Body.

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

What the Body in a HTTP message does?

A

It’s optional. It’s used to include data with the message.

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

What is the first questions a HTTP Request Message needs to answer?

A

What resources is this request concerned with?

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

What is the second questions a HTTP Request Message needs to answer?

A

What do you want to do with that resource?

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

What is the third questions a HTTP Request Message needs to answer?

A

How do you want to modify this request from the default, if at all?

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

What are is the fourth questions a HTTP Request Message needs to answer?

A

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

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

What are HTTP verbs?

A

A command given to the server through the request.

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

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?

A

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.

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

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?

A

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.

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

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

A blank line, meaning the Header item is complete. There is no body.

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

What is this ?firstName=Harry&lastName=Potter?

A

A Query String. The “?” starts the Query String and the “&” separates the key/value pairs.

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

GET /adminportal/get_student?studentId=23
Host: www.exampleschool.com
Accept-Language: en-us

Explain the first section of this HTTP Request message.

A

The method GET is requesting the get_student method to retrive data with the Query String ?studentId=23.

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

GET /adminportal/get_student?studentId=23
Host: www.exampleschool.com
Accept-Language: en-us

What happens server side when the server receives this HTTP Request message?

A

The server will direct the request to the get_student method. It will set aside the output of the program and then apply the HTTP method “GET” to this resource, thus creating a HTTP Response message.

18
Q

For what the Post method is used in a HTTP Request message?

A

To send data to the server in order to create a resource. The data is stored in the request body.

19
Q

POST /adminportal/createOrUpdate_student
Host: www.exampleschool.com
Accept-Language: en-us

studentId=23&firstName=Harry&lastName=Potter

Explain the above HTTP Request message.

A

The Post method is requesting the services of the createOrUpdate_student method in the Start Line.

The headers identify the Host and Accept-Language.

An empty line tells that the headers are finished.

The body give the data that createOrUpdate_student will use to perform the service. Since it’s a POST method, it will create data.

20
Q

For what the PUT method is used in a HTTP Request message?

A

To replace a resource. In effect, to edit it.

21
Q

POST /adminportal/createOrUpdate_student
Host: www.exampleschool.com
Accept-Language: en-us

studentId=23&firstName=Harry&lastName=Potter

In HTTP Request message, if we change POST for PUT, what would change?

A

The data would update some data, not create new data.

22
Q

What is “idempotent” in mathematics?

A

It means: “unchanged when multiplied by itself”.

23
Q

What is “idempotent” means in HTTP verbs?

A

An operation that will produce the same result even if it is performed multiple times.

24
Q

Which one is idempotent, PUT or POST?

A

PUT.

25
Q

Why PUT is idempotent and POST is not?

A

Once you edited some data, to edit it again with the same data don’t change it. But if you create data with the same data, it is new data even though it has the same value.

26
Q

What RESTful stands for?

A

Representational State Transfer.

27
Q

What is RESTful?

A

It is an ageed-upon manner to create APIs for programs to access and modify the state of resources using HTTP Resquest messages.

28
Q

In RESTful there is a URL for every…

A

… service.

29
Q

The URL in a RESTful system that you can use to request a service is called…

A

… the endpoint.

30
Q

Explain this tag: <form action=”” method=”post”.

A

It is the form tag that create a form used to input data. The action attribute specifies where to send the data to. The method specifies the methos used. It can be GET or POST method.

31
Q

Which attribute and value you can use in a <a> tag to open the link in a new tab</a>

A

Attribute target with value “new” or “_black”.

32
Q

What the tag <em> does?</em>

A

Emphasize a text.

Ex: <em>Text empahsized</em>

33
Q

Which of the tag are not semantic elements?

<style
<header
<footer
<div
<main
<article
<br
<span

A

<style
<div
<br
<span

34
Q

How can you embed a video located in the project?

A

With the tag <video></video>

<video width=”320” height=”240” controls
<source src=”Video.mp4” type=”video/mp4”
Sorry, The video coundn’t be found!
</video

35
Q

True or False?: A file path describes the location of a file in a web site’s folder structure.

A

True

36
Q

How can you use bookmarks inside your webpage?

A

First you need to give an Id to an element you want to bookmark.

<h1>Element booked</h1

Then you use the <a> tag to link to the booked element.

<a href="#bookedElement" Go to the element booked</h1
</a></h1>

37
Q

What does PNG stand for?

Portable Network Graphics
Pictures on a Network Gallery
Picture Newly Grafted
Portability in Networking and Graphics

A

Portable Network Graphics

38
Q

Which of the following is best defined as “the general rules applied when writing text in coding”?

Syntax
File path
Naming convention
PNG

A

Naming convention

39
Q

What attribute is used in the anchor tag to open the link in a new browser window or tab?

src
target
style
href

A

target

40
Q

Which one of the following terms is best defined as, “a system that can use the HTTP protocol to be used to monitor and control the state of these various resources.”?

RESTful
API
HTTP verb
Key-value pair

A

RESTful

41
Q

Which of the following is not a semantic element?
Group of answer choices

<footer

<title

<span

<article

A

<span