Thursday, 17 July 2014

Is your API broken?

"Welcome to the Example Rutabaga Company. We’ve got a simple REST API for all your rutabaga needs!"

Indeed, it is simple…

   POST https://rutabaga.example.com/Order/ HTTP/1.1
   Content-Type: application/json

   {"Quantity": 5800,
    "Quality": "Tasty!",
    "DeliverTo": "123 Fake Street, New Orleans"}

Send this and you'll either get an error or an "OK" response with a tracking ID inside. Later, you’ll get several thousand tasty rutabagas in the post. What could go wrong?

Everything.