250+ TOP MCQs on HTTP and Answers

Computer Networks Multiple Choice Questions on “HTTP”.

1. The number of objects in a Web page which consists of 4 jpeg images and HTML text is ________
a) 4
b) 1
c) 5
d) 7

Answer: c
Clarification: 4 jpeg images + 1 base HTML file.

2. The default connection type used by HTTP is _________
a) Persistent
b) Non-persistent
c) Can be either persistent or non-persistent depending on connection request
d) None of the mentioned

Answer: a
Clarification: By default the http connection is issued with persistent connection. In persistent connection server leaves connection open after sending response. As little as one RTT (Time for a small packet to travel from client to server and back) is required for all referenced objects.

3. The time taken by a packet to travel from client to server and then back to the client is called __________
a) STT
b) RTT
c) PTT
d) JTT

Answer: b
Clarification: RTT stands for round-trip time.

4. The HTTP request message is sent in _________ part of three-way handshake.
a) First
b) Second
c) Third
d) Fourth

Answer: c
Clarification: In first step client sends a segment to establish a connection with the server. In the second the step the client waits for the acknowledgement to be received from the server. After receiving the acknowledgement, the client sends actual data in the third step.

5. In the process of fetching a web page from a server the HTTP request/response takes __________ RTTs.
a) 2
b) 1
c) 4
d) 3

Answer: b
Clarification: By default the http connection will be persistent connection. Hence it will take only 1 RTT to fetch a webpage from a server.

6. The first line of HTTP request message is called _____________
a) Request line
b) Header line
c) Status line
d) Entity line

Answer: a
Clarification: The line followed by request line are called header lines and status line is the initial part of response message.

7. The values GET, POST, HEAD etc are specified in ____________ of HTTP message
a) Request line
b) Header line
c) Status line
d) Entity body

Answer: a
Clarification: It is specified in the method field of request line in the HTTP request message.

8. The __________ method when used in the method field, leaves entity body empty.
a) POST
b) SEND
c) GET
d) PUT

Answer: c
Clarification: There are two methods which help to request a response from a server. Those are GET and POST. In GET method, the client requests data from server. In POST method the client submits data to be processed to the server.

9. The HTTP response message leaves out the requested object when ____________ method is used
a) GET
b) POST
c) HEAD
d) PUT

Answer: c
Clarification: HEAD method is much faster than GET method. In HEAD method much smaller amount of data is transferred. The HEAD method asks only for information about a document and not for the document itself.

10. Find the oddly matched HTTP status codes
a) 200 OK
b) 400 Bad Request
c) 301 Moved permanently
d) 304 Not Found

Answer: d
Clarification: 404 Not Found.

11. Which of the following is not correct?
a) Web cache doesnt has its own disk space
b) Web cache can act both like server and client
c) Web cache might reduce the response time
d) Web cache contains copies of recently requested objects

Answer: a
Clarification: Web cache or also known as HTTP cache is a temporary storage where HTML pages and images are stored temporarily so that server lag could be reduced.

12. The conditional GET mechanism
a) Imposes conditions on the objects to be requested
b) Limits the number of response from a server
c) Helps to keep a cache upto date
d) None of the mentioned

Answer: c
Clarification: The HTTP protocol requests the server of the website its trying to access so that it can store its files, images etc. in cache memory. This request of asking the server for a document considering a specific parameter is called conditional GET Request.

13. Which of the following is present in both an HTTP request line and a status line?
a) HTTP version number
b) URL
c) Method
d) None of the mentioned

Answer: a
Clarification: Status line is the the start line of an HTTP response. It contains the information such as the protocol version, a status text, status code.

Leave a Reply

Your email address will not be published. Required fields are marked *