Handling RESTful web services
An increasing number of applications are shifting to RESTful web services due to their simplicity to build, test, and consume as compared to their SOAP counterparts. All REST communication is done over the HTTP protocol between the parties involved. HTTP is used for CRUD (create, read, update, and delete) operations. The built-in HTTP Request
sampler in JMeter is more than up to the task. It supports the GET
, POST
, PUT
, and DELETE
operations, among other things. The body of the request can be in XML or JSON format. An HTTP Header Manager component can be used to send additional HTTP header attributes, if needed.
In our sample, we will create a new person in our sample application using a POST
request, and then we will verify that the person was actually created using a GET
request:
- Create a new test plan.
- Add a new
Thread Group
(by navigating toTest Plan
|Add
|Thread Group
). - Add an
HTTP Request
sampler (this retrieves all the people records in our application...