Testing REST webservices [closed]
Solution 1:
soapUI will do the job as well, check out this blog post to get started.
Solution 2:
Please try Firefox addon Poster , which is simple to use and gets you up nd running quickly
Solution 3:
You can exercise web services using fairly trivial bits of Python. Depending on your security, you may be able to simply use Python's urllib
or urllib2
to do do you REST requests and examine your answers.
Additionally, you might want to use Python unittest
to control the execution of the Python tests of your REST services.
class TestSomeREST( unittest.TestCase ):
def setUp(self):
REALM = "[email protected]"
self.client= RESTClient( "localhost", 18000, "tester", "tester", REALM )
def test_1_get(self):
response = self.client.get('/this/that/other/2/')
self.failUnlessEqual(200, response.status_code)
j1= JSONDecoder().decode(response.content)
self.assertEquals(2, j1[0]['pk'] )
entity= j1[0]['fields']
self.assertEquals('Some Other Group', entity['name'])
self.assertEquals('E1G2', entity['customer_id'])
The RESTClient class uses urllib2 to pass through digest authentication for each request. It's rather complex, but I can share the essence if it's of interest.