HttpExchange
, HttpsExchange
public interface Request
Modifier and Type | Method | Description |
---|---|---|
Headers |
getRequestHeaders() |
Returns an immutable Headers containing the HTTP headers that were included with this request. |
String |
getRequestMethod() |
Returns the request method. |
URI |
getRequestURI() |
Returns the request URI . |
default Request |
with |
Returns an identical Request with an additional header. |
URI getRequestURI()
URI
.URI
String getRequestMethod()
Headers getRequestHeaders()
Headers
containing the HTTP headers that were included with this request. The keys in this Headers
are the header names, while the values are a List
of 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 Headers
are case-insensitive.
Headers
which can be used to access request headers.default Request with(String headerName, List<String> headerValues)
Request
with an additional header. The returned Request
has the same set of headers
as this
request, but with the addition of the given header. All other request state remains unchanged.
If this
request already contains a header with the same name as the given headerName
, then its value is not replaced.
Headers
, h
, then adds all the request headers from this
request to h
, then adds the given name-values mapping if headerName
is not present in h
. Then an unmodifiable view, h'
, of h
and a new Request
, r
, are created. The getRequestMethod
and getRequestURI
methods of r
simply invoke the equivalently named method of this
request. The getRequestHeaders
method returns h'
. Lastly, r
is returned.headerName
- the header nameheaderValues
- the list of header valuesNullPointerException
- if any argument is null, or if any element of headerValues is null.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.httpserver/com/sun/net/httpserver/Request.html