Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to test out a REST API? [closed]

Tags:

json

rest

php

api

I just created a REST API using the PHP Slim Framework. However, I would like to know what the best way would be to test out this API would be. Is it best to test it out using PHP or objective-c (where it will be used) or via some online service which allows you to test out a REST API? All outputs are in JSON.

like image 953
max_ Avatar asked Jul 24 '11 21:07

max_


People also ask

What is the best way to test REST API?

If you are not a big fan of command-line tools and rather like a GUI client to test your REST API then Postman is the best tool for you. It comes as a Chrome extension and you can install it on your chrome browser and from thereon. It is probably the most popular tool to test your REST API.

How do you cover end to end API testing?

Key Steps in Setting up End-to-End Tests:Review the requirements you'll be using end-to-end testing to validate. Set up the test environments and outline the hardware /software requirements. Define all the processes of your systems and its integrated subsystems. Describe the roles and responsibilities for each system.


2 Answers

  • You should already have unit tests for this service (e.g. PHPUnit). This ensures everything works as expected.
  • You may create acceptance tests (e.g. using Selenium)
  • You may test whether the service is accessible using CURL
like image 148
takeshin Avatar answered Oct 10 '22 19:10

takeshin


Postman, an app on the Chrome Webstore is quite good too.

It has a very nice UI. All HTTP methods are supported. It even allows Basic and OAuth autentication and stores your previous requests.

Find the source code on GitHub here.

like image 26
Pramod Avatar answered Oct 10 '22 20:10

Pramod