@Retention(value=CLASS) @Target(value={METHOD,TYPE}) public @interface SetsCookie
Use on Get, Post, … annotated methods to retrieve and store
cookies from the HTTP response.
The annotation value() is mandatory and define a list of cookie's
names you want to keep.
Each stored cookies can be re-used with RequiresCookie and
RequiresCookieInUrl annotations. The getCookie method
will also be able to read these cookies.
Example :
@Rest(rootUrl = "http://myserver", converters = MappingJacksonHttpMessageConverter.class)
public interface MyRestClient {
@Get("/events/{id}")
@SetsCookie(("token"()
Event getEvent(long id);
@Put("/events/update/")
@RequiresCookie("token")
void updateEvent(Event event);
}
Rest,
RequiresCookie,
SetsCookiepublic abstract String[] value
Copyright © 2010-2015. All Rights Reserved.