HTTP Methods and Status Codes Essentials Quiz Quiz

Test your understanding of HTTP methods and status codes with this beginner-friendly quiz. Learn to identify key HTTP operations and recognize the meaning of common status codes in web communication.

  1. Question 1

    Which HTTP method is used to retrieve data from a server without modifying any resources?

    1. UPDATE
    2. GET
    3. POST
    4. DELETE

    Explanation: The GET method requests data from a server and does not modify the resource. POST is used to submit data, possibly creating or modifying resources. UPDATE is not a standard HTTP method; the correct method is PUT or PATCH for updating. DELETE is used to remove resources from the server.

  2. Question 2

    If a web server responds with status code 404, what does it indicate?

    1. Redirection
    2. Server error
    3. Resource not found
    4. Request successful

    Explanation: A 404 status code means the requested resource could not be found on the server. 'Request successful' applies to code 200. 'Server error' is usually represented by codes starting with 5, such as 500. 'Redirection' is indicated by codes in the 300 range, not 404.

  3. Question 3

    Which HTTP status code signals that the request was successful and a new resource was created?

    1. 202
    2. 201
    3. 401
    4. 400

    Explanation: Status code 201 means 'Created', indicating the request succeeded and resulted in the creation of a resource. 400 represents a bad request due to client error. 202 means 'Accepted' but not necessarily completed. 401 means 'Unauthorized', related to authentication issues.

  4. Question 4

    When should you use the HTTP DELETE method in a REST API example?

    1. To retrieve multiple records
    2. To fetch website icons
    3. To remove a specified resource
    4. To upload a new file

    Explanation: The DELETE method is designed to remove or delete a specified resource from the server. Uploading a new file is commonly done with POST or PUT. Retrieving multiple records uses the GET method. Fetching website icons does not require DELETE and would use GET.

  5. Question 5

    A client receives a 403 status code after requesting a webpage. What does this mean?

    1. Resource moved permanently
    2. Request timed out
    3. Server is under maintenance
    4. Access to the resource is forbidden

    Explanation: A 403 status code indicates that the server understood the request but refuses to authorize it. 'Resource moved permanently' corresponds to 301. 'Request timed out' would be 408. 'Server is under maintenance' is generally represented by 503.

  6. Question 6

    Which HTTP method should you use to submit form data that creates or updates a resource?

    1. REMOVE
    2. FETCH
    3. LOOK
    4. POST

    Explanation: POST is the standard method for submitting form data to create or update a resource on the server. FETCH and LOOK are not valid HTTP methods; FETCH is used in JavaScript APIs, not in HTTP. REMOVE is also incorrect; DELETE is the right method for deletions.

  7. Question 7

    If a server sends back a 500 status code, what does it most likely mean?

    1. Unauthorized
    2. Success
    3. Moved temporarily
    4. Internal server error

    Explanation: A 500 status code means an internal server error occurred, indicating something went wrong on the server side. 'Success' is shown by code 200. 'Unauthorized' uses code 401. 'Moved temporarily' refers to status code 302.

  8. Question 8

    What does the HTTP PUT method generally do when applied to a resource at a specific URL?

    1. Retrieves resource headers only
    2. Updates or creates the resource at the URL
    3. Deletes the resource
    4. Initiates a server reboot

    Explanation: PUT is used to update an existing resource or create it if it does not already exist at the specified URL. DELETE is for removal, not for creation or updating. Retrieving resource headers is typically done with the HEAD method. Initiating a server reboot is outside the scope of HTTP methods.

  9. Question 9

    Which HTTP status code indicates that a request requires user authentication?

    1. 401
    2. 200
    3. 418
    4. 301

    Explanation: The 401 status code means 'Unauthorized' and implies the request needs valid user authentication. 301 means 'Moved Permanently', not related to authentication. 200 is 'OK', meaning successful operation. 418 is a playful code, 'I'm a teapot', and is not generally used.

  10. Question 10

    In which situation is the HTTP HEAD method commonly used?

    1. To delete an existing entry
    2. To reload a server
    3. To check resource metadata without downloading its content
    4. To create a new resource

    Explanation: The HEAD method retrieves headers for a resource, letting a client check metadata such as content length without downloading the body. Creating resources is for POST or PUT. Deleting uses DELETE. Reloading a server isn't done through HTTP methods.