Coding assistance for REST development
Besides the common Web services support, IntelliJ IDEA provides the following facilities for developing RESTful Web services:
Code completion for MIME type
Dedicated HTTP Client in IntelliJ IDEA Code Editor
Code Inspection and Quick Fixes
IntelliJ IDEA supports code inspections and suggests quick fixes in the following cases:
Issue | Default Quick Fix |
---|---|
Inconsistency between a method annotation and the method return type: a | Change to String. |
Resource methods errors. | Remove |
Incorrect parameter type. | Validation for parameters annotated with |
|
@GET
public String get(@DefaultValue("33.5") @QueryParam("str") int str){
return "Hello";
}
|
Rest | |
Rest References resolve problems. | References in |
This method should have only one HTTP method designator. | Example:
@GET
@POST
public String get(){
return "Hello";
}
|
HTTP Client in Code Editor
The dedicated HTTP Client provides the following facilities for working with HTTP requests:
Composing and executing requests
Displaying server responses and the executed requests history
Completing the HTTP request parts from the
@Path
and@Produces
annotations specified in the Java code
Change in the Java code | Change in the HTTP request in editor |
---|---|
| The contents of the |
| The contents of the |