nerdexam
Oracle

1Z0-900 · Question #62

Given: What will be the response to a HEAD request?

The correct answer is C. No method will be invoked and no error will be returned. Option C is correct because HTTP HEAD requests are handled entirely at the server/framework level - the infrastructure responds with only the response headers (status, content-type, content-length, etc.) that a GET would return, but no method in your application code is ever…

Implement REST Services using JAX-RS API

Question

Given:

What will be the response to a HEAD request?

Exhibit

1Z0-900 question #62 exhibit

Options

  • AThe findAll() method will be called and the employee list will be returned.
  • BThe findAll() method will be called and no employees will be returned.
  • CNo method will be invoked and no error will be returned.
  • DNo method will be invoked and a 404 error will be returned.

How the community answered

(62 responses)
  • A
    3% (2)
  • B
    6% (4)
  • C
    89% (55)
  • D
    2% (1)

Explanation

Option C is correct because HTTP HEAD requests are handled entirely at the server/framework level - the infrastructure responds with only the response headers (status, content-type, content-length, etc.) that a GET would return, but no method in your application code is ever invoked. Since HEAD is a recognized, standard HTTP method, the server does not throw an error; it simply fulfills the request silently.

Why the distractors are wrong:

  • A is wrong because HEAD never returns a response body - returning an employee list would violate the HTTP spec.
  • B is wrong for the same reason (no body), and additionally because findAll() is not invoked; the framework handles it before reaching your controller.
  • D is wrong because HEAD is a valid, well-known HTTP method - a 404 would only occur if the resource didn't exist, not because of the method type itself.

Memory tip: Think of HEAD as a "silent scout" - it checks that a resource exists and retrieves its metadata (headers) without disturbing the application. No app code runs, no body comes back, no alarm is raised. If GET is knocking on the door and coming inside, HEAD is just checking the doorbell works.

Topics

#HEAD request#JAX-RS HTTP methods#REST endpoint behavior#HTTP semantics

Community Discussion

No community discussion yet for this question.

Full 1Z0-900 Practice