nerdexam
F5

101 · Question #506

Which HTTP response code is returned when a web server requires authentication to access a resource?

The correct answer is B. 401. HTTP 401 Unauthorized is returned by a web server when the requested resource requires valid authentication credentials that were not provided.

Section 1: OSI Model, Network, and Application Delivery Basics

Question

Which HTTP response code is returned when a web server requires authentication to access a resource?

Options

  • A500
  • B401
  • C302
  • D100

How the community answered

(20 responses)
  • A
    5% (1)
  • B
    90% (18)
  • D
    5% (1)

Why each option

HTTP 401 Unauthorized is returned by a web server when the requested resource requires valid authentication credentials that were not provided.

A500

HTTP 500 Internal Server Error indicates an unexpected server-side failure during request processing, not an authentication requirement.

B401Correct

The HTTP 401 status code, defined in RFC 9110, explicitly signals that the request has not been applied because it lacks valid authentication credentials for the target resource. The server typically includes a WWW-Authenticate header in the 401 response to inform the client which authentication scheme is required. This is distinct from 403 Forbidden, where credentials may be present but access is still denied.

C302

HTTP 302 Found is a redirect response that tells the client the resource has temporarily moved to a different URL, and is unrelated to authentication requirements.

D100

HTTP 100 Continue is an informational status indicating the server has received the request headers and the client should proceed to send the request body, not an authentication challenge.

Concept tested: HTTP response status codes - authentication and authorization

Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401

Topics

#HTTP response codes#401 unauthorized#authentication#HTTP protocol

Community Discussion

No community discussion yet for this question.

Full 101 Practice