use of org.apache.hc.client5.http.impl.cookie.BasicClientCookie in project spring-framework by spring-projects.
the class HttpComponentsClientHttpRequest method applyCookies.
@Override
protected void applyCookies() {
if (getCookies().isEmpty()) {
return;
}
CookieStore cookieStore = this.context.getCookieStore();
getCookies().values().stream().flatMap(Collection::stream).forEach(cookie -> {
BasicClientCookie clientCookie = new BasicClientCookie(cookie.getName(), cookie.getValue());
clientCookie.setDomain(getURI().getHost());
clientCookie.setPath(getURI().getPath());
cookieStore.addCookie(clientCookie);
});
}
Aggregations