Self-test questions

To get additional confidence, go through this set of statements and state whether they are true or false:

  • A rest-enabled endpoint must support all HTTP methods relevant to the rest principles
  • In the case of a failed content negotiation, it is up to the API to decide whether to return status 406 Not accepted or the data in a default format, which is different from the requested format
  • Access-Control-Allow-Origin, Access-Control-Allow-Methods, and Access-Control-Allow-Headers are all mandatory CORS response headers
  • When using parameterized routes, the developer can specify the type of the parameter, for example, whether it is a numeric or a literal type

Get RESTful Web API Design with Node.js - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.