Skip to content

Instantly share code, notes, and snippets.

@milancermak
Last active December 11, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milancermak/4518064 to your computer and use it in GitHub Desktop.
Save milancermak/4518064 to your computer and use it in GitHub Desktop.
An example of a good error message coming from an HTTP API (illustrative for http://milancermak.posterous.com/http-apis-and-errors-doing-it-the-right-way)
HTTP/1.1 402 Payment Required
Content-Type: application/json
{
"title": "End of trial",
"description": "Unfortunately, your trial period has ended. To continue using the application, you need to purchase a subscription.",
"explanation_url": "https://example.com/troubleshooting/payment-required",
"trace_url": "https://apilog.example.com/f26a3e1dc"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment