...

/

Design OPTIONS to Inform Clients About Supported Operations

Design OPTIONS to Inform Clients About Supported Operations

Understand the OPTIONS method and design the products API to inform clients about supported operations.

Inform clients about supported operations

A client should be able to query a service for the list of supported operations. In the world of REST APIs, that is achieved by issuing an OPTIONS request to the service. Conversely, a REST service uses the OPTIONS method to inform clients about the supported operations.

According to the specificationsPackage org.jboss.netty.handler.codec.http, “The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.”

According to the above specification, the OPTIONS method has the following features:

  • It’s idempotent. That means multiple OPTIONS requests to the same URI with the same parameters will result in the
...
Access this course and 1400+ top-rated courses and projects.