I want to test my RESTful applications directly via HTTP and I am looking for tools that can help me with that task. Basically I am looking for an easy wrapper for HTTP requests that can submit e.g. HTML forms or serialized resources as JSON or XML.
It would be great if there is a way to verify if the service is actually following REST architectural guidelines (statelessness, URIs, content negotiation etc.), too.
Being able to use it with JUnit would be a convenient bonus. Do you know about any libraries that could help me with what I want to do (and that are a little more than just a simple http client)?
Maybe Selenium can be of some help, but surely not entirely.
Fiddler is a really useful tool, you can create XML based HTTP Requests with a variety of request verbs like GET,POST,PUT,DELETE and so on.
http://www.fiddler2.com/fiddler2/
I think REST Assured will suite you very well. It's very easy to send requests and to parse XML and JSON responses. E.g. let's say that a GET request to "/lotto" returns JSON:
You can make the request and validate the response like this:
See if rest-client is of any help.
Edit: Currently I am using Postman - REST Client a google chrome plugin and it's awesome!
There is also the Jersey Test Framework (http://jersey.java.net/nonav/documentation/latest/user-guide.html#test-framework) but as Johan already mentioned the REST-assured framework I'd also recommend this framework - it has some nice featues like a DSL like syntax, XPath and Schema validation, easy file upload and using Groovy Lambda Expressions to search through returned JSON structures..
I have written two articles..