/** * Returns a map of all trailers in the response, If the response contains multiple trailers with * the same key, the values will be concatenated together into a single header with the same key * value, with each value separated by a comma, as specified <a * href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2">here</a>. * * <p>If trailers have been sent by the server, they won't be available on the client side until * the last chunk is received. */ public Map<String, String> getTrailers() { if (trailers == null) { if (trailer == null) { trailers = new HashMap<>(); } else { trailers = HeaderUtils.simplifyHeaders(trailer.getHeaders()); } } return trailers; }
/** * Returns a map of all headers in the response, If the response contains multiple headers with * the same key, the values will be concatenated together into a single header with the same key * value, with each value separated by a comma, as specified <a * href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2">here</a>. */ public Map<String, String> getHeaders() { if (headers == null) { headers = HeaderUtils.simplifyHeaders(response.getHeaders()); } return headers; }