Exercises

HTTP Requests, Responses, and Caching

Explore the HTTP concepts that power communication between web browsers and servers. This quiz covers safe and idempotent methods, response status codes, conditional requests, cache freshness, content negotiation, cookie security, and CORS preflight requests. The questions combine practical scenarios with visual request-response flows to assess skills useful in both front-end and back-end web development.

Answer the questions below and check the explanation for each answer.

0/10 answered

  1. 1

    Which HTTP method is both safe and idempotent when used according to its defined semantics?

  2. 2

    An API successfully creates a new resource after a POST request. Which response is most appropriate?

  3. 3

    In the illustrated conditional request, the server determines that the browser's cached representation is still current. Which status code should the server return without sending the representation body again?

    Question 3
  4. 4

    Why is PUT classified as an idempotent HTTP method?

  5. 5

    An authenticated user requests a resource but lacks permission to access it. Which status code is generally appropriate?

  6. 6

    The image shows a response cached at 10:00:00 with Cache-Control: max-age=300. Assuming no other caching directives apply, what is its state at 10:02:00?

    Question 6
  7. 7

    Which request header allows a client to state which response media types it can process?

  8. 8

    The diagram shows a cookie being sent automatically with HTTP requests while client-side JavaScript is blocked from reading it. Which cookie attribute produces this behavior?

    Question 8
  9. 9

    A browser is about to send a cross-origin PUT request with a custom header, as illustrated. Which HTTP method does it normally use for the CORS preflight request?

    Question 9
  10. 10

    What does a weak entity tag such as W/"v1" indicate about HTTP cache validation?

Video Courses

Courses related to this topic

See all video courses

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate