本文整理了Java中org.eclipse.jetty.client.api.Request.getCookies
方法的一些代码示例,展示了Request.getCookies
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getCookies
方法的具体详情如下:
包路径:org.eclipse.jetty.client.api.Request
类名称:Request
方法名:getCookies
暂无
代码示例来源:origin: apache/incubator-druid
@Override
public void decorateProxyRequest(
HttpServletRequest clientRequest,
HttpServletResponse proxyResponse,
Request proxyRequest
)
{
Object cookieToken = clientRequest.getAttribute(SIGNED_TOKEN_ATTRIBUTE);
if (cookieToken != null && cookieToken instanceof String) {
log.debug("Found cookie token will attache it to proxyRequest as cookie");
String authResult = (String) cookieToken;
String existingCookies = proxyRequest.getCookies()
.stream()
.map(HttpCookie::toString)
.collect(Collectors.joining(";"));
proxyRequest.header(HttpHeader.COOKIE, Joiner.on(";").join(authResult, existingCookies));
}
}
代码示例来源:origin: isucon/isucon5-final
public void writeCookie(Request req) {
List<HttpCookie> existing = req.getCookies();
synchronized(cookies) {
for (HttpCookie cookie : cookies) {
boolean exists = false;
for (HttpCookie e : existing) {
if (e.getName().equals(cookie.getName())) {
e.setValue(cookie.getValue());
exists = true;
break;
}
}
if (! exists) {
req.cookie(cookie);
}
}
}
}
代码示例来源:origin: isucon/isucon5-qualify
public void writeCookie(Request req) {
List<HttpCookie> existing = req.getCookies();
synchronized(cookies) {
for (HttpCookie cookie : cookies) {
boolean exists = false;
for (HttpCookie e : existing) {
if (e.getName().equals(cookie.getName())) {
e.setValue(cookie.getValue());
exists = true;
break;
}
}
if (! exists) {
req.cookie(cookie);
}
}
}
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
if (uri != null)
cookies = convertCookies(HttpCookieStore.matchPath(uri, cookieStore.get(uri)), null);
cookies = convertCookies(request.getCookies(), cookies);
if (cookies != null)
request.header(HttpHeader.COOKIE.asString(), cookies.toString());
内容来源于网络,如有侵权,请联系作者删除!