本文整理了Java中io.micronaut.http.HttpRequest.getCookies()
方法的一些代码示例,展示了HttpRequest.getCookies()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpRequest.getCookies()
方法的具体详情如下:
包路径:io.micronaut.http.HttpRequest
类名称:HttpRequest
方法名:getCookies
暂无
代码示例来源:origin: micronaut-projects/micronaut-core
@Override
public Cookies getCookies() {
return getDelegate().getCookies();
}
代码示例来源:origin: micronaut-projects/micronaut-core
@Override
public BindingResult<T> bind(ArgumentConversionContext<T> argument, HttpRequest<?> source) {
ConvertibleValues<io.micronaut.http.cookie.Cookie> parameters = source.getCookies();
AnnotationMetadata annotationMetadata = argument.getAnnotationMetadata();
String parameterName = annotationMetadata.getValue(CookieValue.class, String.class)
.orElse(argument.getArgument().getName());
return doBind(argument, parameters, parameterName);
}
代码示例来源:origin: micronaut-projects/micronaut-core
byType.put(Argument.of(HttpRequest.class).typeHashCode(), (RequestArgumentBinder<HttpRequest>) (argument, source) -> () -> Optional.of(source));
byType.put(Argument.of(HttpParameters.class).typeHashCode(), (RequestArgumentBinder<HttpParameters>) (argument, source) -> () -> Optional.of(source.getParameters()));
byType.put(Argument.of(Cookies.class).typeHashCode(), (RequestArgumentBinder<Cookies>) (argument, source) -> () -> Optional.of(source.getCookies()));
byType.put(Argument.of(Cookie.class).typeHashCode(), (RequestArgumentBinder<Cookie>) (context, source) -> {
Cookies cookies = source.getCookies();
String name = context.getArgument().getName();
Cookie cookie = cookies.get(name);
代码示例来源:origin: io.micronaut/micronaut-http
@Override
public Cookies getCookies() {
return getDelegate().getCookies();
}
代码示例来源:origin: io.micronaut/micronaut-http
@Override
public BindingResult<T> bind(ArgumentConversionContext<T> argument, HttpRequest<?> source) {
ConvertibleValues<io.micronaut.http.cookie.Cookie> parameters = source.getCookies();
AnnotationMetadata annotationMetadata = argument.getAnnotationMetadata();
String parameterName = annotationMetadata.getValue(CookieValue.class, String.class)
.orElse(argument.getArgument().getName());
return doBind(argument, parameters, parameterName);
}
代码示例来源:origin: micronaut-projects/micronaut-spring
@Override
protected MultiValueMap<String, HttpCookie> initCookies() {
final Cookies cookies = request.getCookies();
MultiValueMap<String, HttpCookie> cookieMultiValueMap = new LinkedMultiValueMap<>();
cookies.forEach((s, cookie) -> {
final HttpCookie httpCookie = new HttpCookie(cookie.getName(), cookie.getValue());
cookieMultiValueMap.set(s, httpCookie);
});
return cookieMultiValueMap;
}
代码示例来源:origin: io.micronaut/micronaut-http
byType.put(Argument.of(HttpRequest.class).typeHashCode(), (RequestArgumentBinder<HttpRequest>) (argument, source) -> () -> Optional.of(source));
byType.put(Argument.of(HttpParameters.class).typeHashCode(), (RequestArgumentBinder<HttpParameters>) (argument, source) -> () -> Optional.of(source.getParameters()));
byType.put(Argument.of(Cookies.class).typeHashCode(), (RequestArgumentBinder<Cookies>) (argument, source) -> () -> Optional.of(source.getCookies()));
byType.put(Argument.of(Cookie.class).typeHashCode(), (RequestArgumentBinder<Cookie>) (context, source) -> {
Cookies cookies = source.getCookies();
String name = context.getArgument().getName();
Cookie cookie = cookies.get(name);
内容来源于网络,如有侵权,请联系作者删除!