|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=CLASS)
@Target(value={METHOD,TYPE})
public @interface Accept
Use on Get, Post, … annotated methods to negotiate the
response format expected, and so the converter to use.
value() is mandatory and define the media type to
accept. We provide a MediaType class to help you.
Example :
@Rest(rootUrl = "http://myserver", converters = { MappingJacksonHttpMessageConverter.class, SimpleXmlHttpMessageConverter.class })
public interface MyRestClient {
@Get("/events/{id}")
@Accept(MediaType.APPLICATION_JSON)
Event getEvent(long id);
@Post("/entity")
@Accept(MediaType.APPLICATION_XML)
Event addEvent(Event event);
}
Rest,
Get,
Post,
Put,
Delete,
Head,
Options| Required Element Summary | |
|---|---|
String |
value
|
| Element Detail |
|---|
public abstract String value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||