HTTP Methods
Which HTTP method is conventionally used to update an entire resource in a RESTful API?
- PUT
- GET
- PATCH
- PULL
- POT
Resource Naming
In RESTful design, which URI is considered the best practice for accessing the list of all books?
- /books
- /book-list
- /getAllBooks
- /Books
- /book
Status Codes
What HTTP status code should a RESTful API return after successfully creating a new resource?
- 201
- 200
- 204
- 301
- 503
Versioning
Which is the recommended way to version a RESTful API?
- Including the version in the URI, like /v1/products
- Adding a 'version' parameter in the request body
- Storing version in a cookie
- Appending version with a hash symbol (/products#v1)
- Relying on user-agent headers to imply version
Error Message Format
What format is MOST commonly used for error messages in a modern RESTful API?
- JSON object
- Plain text
- CSV
- XML only
- YAML
Idempotency
Which HTTP methods are defined as idempotent in RESTful APIs? Select the most correct option.
- GET, PUT, DELETE, HEAD, OPTIONS
- POST, PUT, GET, PATCH
- DELETE, POST, PATCH
- POST, GET, UPDATE
- PUT, PATCH, POST
Partial Updates
When partially updating a resource using a REST API, which HTTP method should you use?
- PATCH
- POST
- GET
- PUT
- FETCH
Filtering and Query Parameters
What is the most RESTful way to filter a list of users by role using query parameters?
- /users?role=admin
- /users/role/admin
- /user/filter/role/admin
- /users#role-admin
- /usersu0026role:admin
HATEOAS Principle
What is the purpose of HATEOAS in a RESTful API?
- To allow clients to dynamically discover actions via hyperlinks
- To ensure resource names follow camelCase
- To validate input data before processing
- To optimize server-side caching
- To enforce single sign-on authentication
Authentication Practices
Which authentication mechanism is commonly used in RESTful APIs for stateless and secure access?
- Bearer token (e.g., JWT)
- Session ID cookies
- Basic HTML authentication
- OAuth2 consent flow only
- Login with FTP