Computer Network MCQ Questions - HTTP

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

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.

2. 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
Explanation: By default the http connection will be persistent connection. Hence it will take only 1 RTT to fetch a webpage from a server.

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

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

4. 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
Explanation: It is specified in the method field of request line in the HTTP request message.

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

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.

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

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.

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

Answer: d
Explanation: 404 Not Found.

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

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

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



Why Computer Network ?

HTTP Demystified: What's the Buzz?


HTTP, or Hypertext Transfer Protocol, is the backbone of web communication. It's like the courteous waiter in a restaurant, ensuring smooth interaction between your browser and the server. When you type in that URL and hit enter, HTTP starts its magic.

The Request-Response Tango


You're at a fancy restaurant (the server) and craving a pizza (your browser). You politely ask the waiter (HTTP request) for a Margherita, and voila! The chef (server) gets to work, cooks up the pizza (HTTP response), and serves it right on your table (your screen). Seamless, right?

HTTP in a Nutshell: Simple as 1-2-3


1. Client Sends a Request: Your browser shouts, "Hey server, I need that webpage!" in an HTTP request.

2. Server Processes the Request: The server, like a diligent chef, whips up the requested webpage.

3. Server Sends Back a Response: The server sends the webpage (HTTP response) back to your browser, and you enjoy the digital feast.

HTTP Methods: More Than Just Fancy Utensils


Ever wondered how your browser knows whether to get, post, or delete data? That's where HTTP methods come in. Think of them as the different tools in a Swiss army knife. GET fetches data, POST submits data, and DELETE removes data. It's like choosing the right utensil for the job!

In a nutshell, HTTP is the unsung hero of your web-surfing adventures. So, the next time you're clicking away, remember, it's HTTP that's making the internet dance to your tune. Happy browsing!