Wednesday, June 26, 2013

ABC of REST

Always Backward Compatible!

You find this awesome REST service that delivers just the stuff you need for your cool new app, but are afraid to use it!  I hear this all the time.  What if it changes?  Isn't this why SOAP/WSDL is better?  First off, SOAP/WSDL is not even better than sending smoke signals so let that go dude.  Secondly, REST can work just fine if we all agree on a few basic things.  I publish and consume REST services from mobile and heavy apps and have never had a problem.  Like anything else, it requires thinking about the service evolution a little before throwing it together.

  1. Will my service need to evolve
  2. How can I support different versions of my service
First off, provide a header element in the request that allows the consumer to specify which version of your service they require.  Switch on the version and provide the response they know and love.

No comments:

Post a Comment