BP140: Use HTTP headers for content negotiation

Many APIs allow a caller to define what format the content should be returned in. Often this is either JSON or XML.

We recommend to use HTTP headers for defining the format of the content.

When HTTP headers are used the URL is more readable and doesn't contain unnecessary format definition.

Download Better Coder application to your phone and get unlimited access to the collection of enterprise best practices.

Get it on Google Play