@GetMapping: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 9: Line 9:
It may also contain a sub-path relative to the class-level base path, usually configured with [[@RequestMapping]].
It may also contain a sub-path relative to the class-level base path, usually configured with [[@RequestMapping]].


=HTTP GET Semantics for REST Applications=
=REST=
 
<syntaxhighlight lang='java'>
@RestController
@RequestMapping(path = "/a", produces = "application/json")
public class AController {
 
  @GetMapping
  public Collection<A> get() {
    return ...
  }
}
</syntaxhighlight>
 
==HTTP GET Semantics for REST Applications==
{{Internal|REST_and_Hypermedia#GET|HTTP GET Semantics for REST Applications}}
{{Internal|REST_and_Hypermedia#GET|HTTP GET Semantics for REST Applications}}

Revision as of 01:26, 13 March 2019

Internal

Overview

The annotation indicates that the annotated method handles GET request for the path provided as argument of the annotation.

It may also contain a sub-path relative to the class-level base path, usually configured with @RequestMapping.

REST

@RestController
@RequestMapping(path = "/a", produces = "application/json")
public class AController {

  @GetMapping
  public Collection<A> get() {
     return ...
  }
}

HTTP GET Semantics for REST Applications

HTTP GET Semantics for REST Applications