/** * Set the 'User-Agent' header to given value * * @param userAgent * @return this request */ public HttpRequest userAgent(final String userAgent) { return header(HEADER_USER_AGENT, userAgent); }
/** * Get the 'Cache-Control' header from the response * * @return cache control */ public String cacheControl() { return header(HEADER_CACHE_CONTROL); }
/** * Set the 'Accept' header to given value * * @param accept * @return this request */ public HttpRequest accept(final String accept) { return header(HEADER_ACCEPT, accept); }
/** * Get the 'Cache-Control' header from the response * * @return cache control */ public String cacheControl() { return header(HEADER_CACHE_CONTROL); }
/** * Set the 'Accept' header to given value * * @param value * @return this request */ public HttpRequest accept(final String value) { return header(HEADER_ACCEPT, value); }
/** * Get the 'Content-Encoding' header from the response * * @return this request */ public String contentEncoding() { return header(HEADER_CONTENT_ENCODING); }
/** * Get the 'Location' header from the response * * @return location */ public String location() { return header(HEADER_LOCATION); }
/** * Set the 'Accept-Charset' header to given value * * @param acceptCharset * @return this request */ public HttpRequest acceptCharset(final String acceptCharset) { return header(HEADER_ACCEPT_CHARSET, acceptCharset); }
/** * Get the 'Server' header from the response * * @return server */ public String server() { return header(HEADER_SERVER); }
/** * Set the 'Accept-Encoding' header to given value * * @param value * @return this request */ public HttpRequest acceptEncoding(final String value) { return header(HEADER_ACCEPT_ENCODING, value); }
/** * Set the 'Accept-Charset' header to given value * * @param value * @return this request */ public HttpRequest acceptCharset(final String value) { return header(HEADER_ACCEPT_CHARSET, value); }
/** * Set the 'User-Agent' header to given value * * @param value * @return this request */ public HttpRequest userAgent(final String value) { return header(HEADER_USER_AGENT, value); }
/** * Get the 'Cache-Control' header from the response * * @return cache control */ public String cacheControl() { return header(HEADER_CACHE_CONTROL); }
/** * Set the 'Authorization' header to given value * * @param value * @return this request */ public HttpRequest authorization(final String value) { return header(HEADER_AUTHORIZATION, value); }
/** * Set the 'Accept' header to given value * * @param value * @return this request */ public HttpRequest accept(final String value) { return header(HEADER_ACCEPT, value); }
/** * Set header to have given entry's key as the name and value as the value * * @param header * @return this request */ public HttpRequest header(final Entry<String, String> header) { return header(header.getKey(), header.getValue()); }
/** * Set header to have given entry's key as the name and value as the value * * @param header * @return this request */ public HttpRequest header(final Entry<String, String> header) { return header(header.getKey(), header.getValue()); }
/** * Get all parameters from header value in response * <p> * This will be all key=value pairs after the first ';' that are separated by * a ';' * * @param headerName * @return non-null but possibly empty map of parameter headers */ public Map<String, String> parameters(final String headerName) { return getParams(header(headerName)); }
/** * Get parameter with given name from header value in response * * @param headerName * @param paramName * @return parameter value or null if missing */ public String parameter(final String headerName, final String paramName) { return getParam(header(headerName), paramName); }
/** * Get all parameters from header value in response * <p> * This will be all key=value pairs after the first ';' that are separated by * a ';' * * @param headerName * @return non-null but possibly empty map of parameter headers */ public Map<String, String> parameters(final String headerName) { return getParams(header(headerName)); }