Sauce Labs Customer Idea Portal

Submit an idea and make Sauce Labs even better!

Return a nice error message when users POST instead of PUT to the REST API

The REST API uses the PUT verb to update job metadata. If a user instead uses the POST verb, the API returns a 404.

Semantically, this is correct; PUT is idempotent and POST is not, among other reasons (Which you can read here, should you be inclined.)

However, it's not uncommon to use POST for similar apis and it's very easy to get them confused. The error message returned is a standard 404 Not Found, which is extremely unhelpful.

It would be useful and friendly to customers to instead return a suggestion, eg:

404 Not Found - If updating a job, use PUT instead of POST.

  • Dylan Lacey
  • Apr 16 2020
  • Future consideration
  • Attach files