Computer Networks Questions & Answers – HTTP

This set of Computer Networks Multiple Choice Questions & Answers (MCQs) focuses 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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: a
Explanation: 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
View Answer

Answer: b
Explanation: RTT stands for round-trip time.
advertisement
advertisement

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

Answer: c
Explanation: 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
View Answer

Answer: b
Explanation: By default the http connection will be persistent connection. Hence it will take only 1 RTT to fetch a webpage from a server.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: a
Explanation: 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
View Answer

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

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

Answer: c
Explanation: 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
View Answer

Answer: c
Explanation: 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.
advertisement

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

Answer: d
Explanation: 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
View Answer

Answer: a
Explanation: 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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: a
Explanation: 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.

Sanfoundry Global Education & Learning Series – Computer Networks.

To practice all areas of Computer Networks, here is complete set of 1000+ Multiple Choice Questions and Answers.
`

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.