Cover by Lorna Jane Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Chapter 11. Debugging Web Services

Anyone with extensive development experience has, by default, extensive debugging experience. Many of the skills learned as a PHP developer on more traditional web applications will be very useful when working with APIs also. Understanding how the pieces go together is probably the most important part of the puzzle. When you see a problem, is that something that happened in the server? During transfer? Did the client not understand the response it received? And, if you have an application consuming an API, is that your application or the remote API with the problem? Narrowing down where exactly to look when things go wrong will save time and sanity.

Particularly on complex projects, it’s easy for “it’s not working” to be blamed on an API, especially if different teams take responsibility for different system components. In one of these situations, the team providing the API created a requirement that all bug reports be provided with a replication case using only curl. This caused grumbling from the developers of the consuming application, however after the end of the project, it emerged that half of the “bugs” in the API were in fact bugs in the consuming application code, and those developers had been able to track down and squash the bugs in their own system without interrupting the work of the API team. To this day I recommend curl or other very simple replication cases, excluding as many other components as possible.

Whether you get a great curl ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required