Skip to content
Pixel
العربية

Textbook answers: 3-2 Web Application Communication Methods

Suggested answers by the site team, the book has no answer key.

Try 1

1What is the term for the side that requests data or processing from the server (e.g., a web browser)?

Show answer

The client.

A client is a program or device that sends a request to another service asking for data or processing, such as a web browser or a phone app.

2What is the term for the side that receives requests from clients, processes them, and returns responses?

Show answer

The server.

The server is the side that receives requests from clients, processes them and sends back responses.

3What is the term for the communication protocol that adds encryption to HTTP?

Show answer

HTTPS.

HTTPS is HTTP used over a secure TLS connection, which protects confidentiality and integrity and helps authenticate the server.

Note: Arabic edition: The English version asks for 'the protocol that adds encryption to HTTP'; the Arabic asks for 'the protocol used to access the web over a secure TLS connection'. The answer is the same: HTTPS.

4What is the term for the HTTP method for retrieving data from the server?

Show answer

GET.

GET is usually used to request a resource or data from the server, such as viewing a web page or getting search results.

5What is the term for the system for exchanging data between different pieces of software?

Show answer

An API (Application Programming Interface).

An API is a set of clear rules that lets one program request data or functions from another, so different pieces of software can exchange data.

Try 2

(1)From the following options (A–D), choose the combination of status code and meaning that is NOT appropriate.

  • A - 200, The request was processed successfully
  • B - 404, Page not found
  • C - 500, The request was processed successfully
  • D - 500, A problem occurred on the server side
Show answer

C: 500 – the request was processed successfully.

The question asks for the unsuitable pairing. 500 means an internal server error that stopped the request being completed; success is 200. The other pairings (A, B, D) are correct.

(2)From the following options (A–D), choose the one that most appropriately describes an API.

  • A - A technology for adjusting the appearance of web pages
  • B - A system for exchanging data between different pieces of software
  • C - A technology for encrypting data and sending it safely
  • D - An HTTP method for retrieving data from the server
Show answer

B: a system for exchanging data between different pieces of software.

An API is a set of rules letting one program request data or functions from another. A describes styling technology, C describes what HTTPS does, and D describes the GET method.

Exercise 1

1Cover the Point! section with a red plastic sheet and quiz yourself in your notebook in numerical order.

Show answer

Cover the Point! section and answer from memory: define client and server, explain HTTP versus HTTPS, the roles of GET and POST, the meanings of 200, 404 and 500, and what an API and JSON are. Then uncover it, check your answers and mark what you missed.

This is a retrieval exercise; recalling before checking fixes the terms better than rereading. Focus your review on what you got wrong, especially 404 versus 500.

Note: Arabic edition: The English version suggests covering the section with a red plastic sheet; the Arabic asks you to answer without looking at the 'ملحوظة مهمة' section and then review.

Exercise 2

1Read the following passage and answer each question.
A web application operates by communication between a ( a ), which requests data or processing from the server, and a ( b ), which receives the request, processes it, and returns a response. This communication uses a protocol called ( c ). The protocol that adds SSL/TLS encryption to ( c ) is called ( d ).
1. Fill in the blanks (a)–(d).

Show answer

(1) client, (2) server, (3) HTTP, (4) HTTPS.

The client sends the request, the server receives, processes and responds, the web's message-exchange protocol is HTTP, and using it over a secure TLS connection is HTTPS.

Note: Arabic edition: The English blanks are (a)–(d) and describe HTTPS as adding SSL/TLS encryption; the Arabic blanks are (1)–(4) and mention TLS only.

Exercise 3

(1)For each of operations (a–d), indicate which HTTP method is used: A GET, B POST.
a Displaying a web page
b Entering an ID and password into a login form and submitting them
c Displaying search results
d Submitting the contents of a contact form

  • A - GET
  • B - POST
Show answer

1: A (GET), 2: B (POST), 3: A (GET), 4: B (POST).

Viewing a page and viewing search results request a resource or data, so they normally use GET. Sending an ID and password, and sending a contact form, send data for the server to process, so they use POST.

(2)From the following options (A–D), choose the one that most appropriately describes HTTPS.

  • A - A method for retrieving data from the server
  • B - A system for exchanging data between different pieces of software
  • C - A communication protocol that adds SSL/TLS encryption to HTTP
  • D - A status code indicating that a problem has occurred on the server side
Show answer

C: a protocol that uses HTTP over a TLS-protected connection.

This is the book's definition of HTTPS. A describes GET, B describes an API, and D describes code 500.

Note: Arabic edition: Option C in the English version says it 'adds SSL/TLS encryption to HTTP'; the Arabic says it 'uses HTTP over a TLS-protected connection'. The intended answer is the same.

read json

1اقرأ البيانات (JSON): تأمّل هذه البيانات بصيغة JSON، ثم حدّد: مفتاحًا (key) واحدًا، والقيمة (value) المقابلة له. (انظر code-1)

Show answer

The key "city" with the value "Cairo" (or: the key "temperature" with the value 31).

In each pair the key comes before the colon and the value after it. The value of city is text (it is in quotes); the value of temperature is a number. Either pair is enough.

Note: Arabic edition: This activity appears only in the Arabic edition.

Exam-style question

Explain what happens, step by step, when a browser requests a web page and the server responds. Refer to: client, request, HTTP method, response, status code. [6]

Model answer

• The user types the page address or clicks a link, and the browser acts as the client: the program that sends a request to a service on the server. [1]
• The client sends a request across the network following the rules of HTTP (or HTTPS when it goes over a secure TLS connection). [1]
• The request carries an HTTP method stating the kind of operation; to fetch a page GET is normally used (whereas POST sends data for the server to process). [1]
• The server receives the request, processes it, and finds and prepares the requested page. [1]
• The server sends a response back to the client containing the requested page or data, and the browser displays it. [1]
• The response includes an HTTP status code reporting the result: 200 success, 404 if the resource does not exist at that address, or 500 if an internal server error stopped the request being completed. [1]

Back to the lessonStart exercises