protected void addCookies ( final HttpRequest httpRequest ) { // prepare all cookies List < Cookie > cookiesList = new ArrayList <> ( ) ; if ( ! cookies . isEmpty ( ) ) { for ( Map . Entry < String , Cookie > cookieEntry : cookies ) { cookiesList . add ( cookieEntry . getValue ( ) ) ; } httpRequest . cookies ( cookiesList . toArray ( new Cookie [ 0 ] ) ) ; } }
Add cookies to the request .