神刀安全网

5 tools to help developing and testing APIs

Here are some very useful tools that can assist you while developing, debugging and testing web APIs.

1. Postman

Postman used to be a simple Chrome plugin to execute requests in a user-friendly interface where you could try different types of request parameters and inspect responses. But it has grownup and now it not only it helps you executing and inspecting the requests but it’s also a full-featured tool to test APIs, both locally and in production. It runs locally and allows you to create environments so it’s easy to change between local and production requests. It has support for multiple authentication methods (like OAuth1, OAuth2, Basic authentication) so you don’t have to bother with complicated schemes. Tests are very easy to write and can be done in JavaScript. The interface is simple and after some tweaking you are ready to start building your test suite. There’s also a paid plan where you can share everything among your team and keep things synced.

2. Runscope

Runscope is in some ways similar to Postman, but it’s made to work with your production endpoints. You can configure it to run every day or every few minutes and let you know if some endpoint is behaving differently than expected. Tests are configured in a web interface. Apart from its tests functionalities it has a couple of other useful tools. For example you can setup a middleware that will capture requests and responses for inspection. It goes like this: suppose you are making a call to a third party API, you can send the request to Runscope, it will record everything about the request, send it to the third party, record the response and send it back to your system. It also offers libs that will make the whole process almost transparent to your system.

3. ngrok

ngrok provides a way for you to expose your local environment to the web. There are many applications for this, one of the most interesting is testing integrations with web hooks. Requests made to ngrok can be routed to your local machine allowing you to assure everything is working before pushing to production. Another cool use case is being able to exposing an API under development to a mobile app.

4. RequestBin

RequestBin is a very simple service that will record requests. It’s just like the Runscope tool but it will not forward the call. The advantage is that there’s no setup needed, you simply create a URL to listen to calls and can start using it. This is a quick way to investigate if a client is doing requests correctly.

5. Frisby.js

Frisby is for the ones that want to perform tests on APIs but don’t want to deal with web interfaces. It is a library that relies on Node.js and Jasmine to allow you to make requests and test responses in a simple way. Here you will be free to write JavaScript code and organize environments as you wish. After writing your tests you may want to setup a CI to run them.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » 5 tools to help developing and testing APIs

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址