What is the purpose of the 'Host' header in an HTTP/1.1 request? MCQ with Answer and Explanation

What is the purpose of the 'Host' header in an HTTP/1.1 request?
A. To indicate the client's hostname
B. To define the content encoding
C. To enable virtual hosting by specifying the domain name
D. To set the connection type
Answer: Option C
Solution (By JKSSB Mock Tests)
The Host header is mandatory in HTTP/1.1 to differentiate between websites hosted on the same IP address.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Internet and Web Technologies Questions

Question #1
Which HTTP method is idempotent?
A. POST
B. Both PUT and DELETE
C. PUT
D. DELETE

Correct Answer: Option B


Explanation:
PUT and DELETE are idempotent: multiple identical requests have the same effect as a single request. POST is not idempotent.

This question belongs to: Computer Internet and Web Technologies
Question #2
What does a '401 Unauthorized' HTTP response status code indicate to an accessing client?
A. The target website has moved permanently to a fresh alternative domain.
B. The web server cannot locate the directory page requested.
C. The connection timed out due to physical fiber faults.
D. The requested resource requires valid user authentication credentials (like a username and password) before access is granted.

Correct Answer: Option D


Explanation:
The 401 status code indicates that the request lacks valid authentication credentials for the target resource, requiring the user to log in first.

This question belongs to: Computer Internet and Web Technologies
Question #3
What is the default port number for HTTP?
A. 25
B. 443
C. 21
D. 80

Correct Answer: Option D


Explanation:
Port 80 is the default port for HTTP communication. Port 443 is for HTTPS, port 21 for FTP, and port 25 for SMTP.

This question belongs to: Computer Internet and Web Technologies