- the request
getRequestMethodString getRequestMethod()Returns the request method.
- the request method string
getRequestHeadersHeaders getRequestHeaders()Returns an immutable
Headerscontaining the HTTP headers that were included with this request.
The keys in this
Headersare the header names, while the values are a
Listof Strings containing each value that was included in the request, in the order they were included. Header fields appearing multiple times are represented as multiple string values.
The keys in
- a read-only
Headerswhich can be used to access request headers.
withReturns an identical
Requestwith an additional header.
Requesthas the same set of
thisrequest, but with the addition of the given header. All other request state remains unchanged.
thisrequest already contains a header with the same name as the given
headerName, then its value is not replaced.
- Implementation Requirements:
- The default implementation first creates a new
h, then adds all the request headers from
h, then adds the given name-values mapping if
headerNameis not present in
h. Then an unmodifiable view,
hand a new
r, are created. The
rsimply invoke the equivalently named method of
headerName- the header name
headerValues- the list of header values
- a request
NullPointerException- if any argument is null, or if any element of headerValues is null.