HTTP Methods
The client interface can be annotated with the following annotations to specify the HTTP method to be used for the request:
@GetMapping
@PostMapping
@PutMapping
@DeleteMapping
@PatchMapping
@RequestMapping
(withmethod
attribute set to the desired HTTP method)
@RavenApiClient(name = "getExampleClient")
public interface GETExampleClient {
@GetMapping(value = "/getRequest",
produces = MediaType.APPLICATION_JSON_VALUE)
Mono<ResponseEntity<String>> getRequest();
@RequestMapping(value = "/getRequest",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
Mono<ResponseEntity<String>> getRequestWithRequestMapping();
}
In the above example, the getRequest
method is annotated with @GetMapping
and the getRequestWithRequestMapping
method is annotated with @RequestMapping
with the method
attribute set to RequestMethod.GET
. Both methods will make a GET request to the /getRequest
endpoint.