A RESTful web API (also called a RESTful web service) is a web API implemented using HTTP and REST principles. Unlike SOAP-based web services, there is no "official" standard for RESTful web APIs. This is because REST is an architectural style, unlike SOAP, which is a protocol. Typically REST web services expose their operations as a series of unique "resources" which correspond to a specific URL. Each of the standard HTTP methods (POST, GET, PUT and DELETE) then maps into the four basic CRUD (Create, Read, Update and Delete) operations on each resource. REST web services can use different data serialization methods (XML, JSON, RSS, etc.).
There are two main use cases when you need to compose and run requests to a RESTful Web service:
When you have developed and deployed a RESTful Web service and want to make sure it works as expected: that it is accessible in compliance with the specification and that it responds correctly.
Testing a RESTful Web service includes the following checks:
• That URL addresses are constituted correctly based on the service deployment end-point and the method annotations.
• That the generated server requests call the corresponding methods.
• That the methods return acceptable data.
IntelliJ IDEA enables you to run these checks from the REST Client tool window by composing and submitting requests to the local server, viewing and analyzing server responses.
• If you are going to test your own Web service, make sure it is deployed and running.
• Choose Tools | Test RESTful Web Service. The REST Client dedicated tool windowopens.
• To have IntelliJ IDEA generate an authentication header which will be used in basic authentication, click the Generate Authorization Header button and in the dialog box that opens, specify your user name and password for accessing the target RESTful Web service through. Based on these credentials IntelliJ IDEA will generate an authentication header which will be used in basic authentication.
• Select the test request method from the HTTP method drop-down list. The available options are: