Package org.openqa.selenium.remote.http
Class HttpRequest
java.lang.Object
org.openqa.selenium.remote.http.HttpRequest
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a header with thename
andvalue
, headers with the same (case-insensitive) name will be preserved.addQueryParameter
(String name, String value) Set a query parameter, adding to existing values if present.void
forEachHeader
(BiConsumer<String, String> action) Calls theaction
for all headers set.getAttribute
(String key) Retrieves a user-defined attribute of this message.Returns the value of the first header with thename
(case-insensitive).Returns an iterable with all the names of the headers set.getHeaders
(String name) Returns an iterable of the values of headers with thename
(case-insensitive).getQueryParameter
(String name) Get a query parameter.getQueryParameters
(String name) getUri()
removeAttribute
(String key) removeHeader
(String name) Removes all headers with thename
(case-insensitive).setAttribute
(String key, Object value) setContent
(Supplier<InputStream> supplier) Deprecated.setContent
(Contents.Supplier supplier) Removes all headers with thename
(case-insensitive) and adds a header with thevalue
.toString()
-
Constructor Details
-
HttpRequest
-
-
Method Details
-
getUri
-
getMethod
-
getQueryParameter
Get a query parameter. The implementation will take care of decoding from the percent encoding. -
addQueryParameter
Set a query parameter, adding to existing values if present. The implementation will ensure that the name and value are properly encoded. -
getQueryParameterNames
-
getQueryParameters
-
toString
-
getAttribute
Retrieves a user-defined attribute of this message. Attributes are stored as simple key-value pairs and are not included in a message's serialized form.- Parameters:
key
- attribute name- Returns:
- attribute object
-
setAttribute
-
removeAttribute
-
getAttributeNames
-
forEachHeader
Calls theaction
for all headers set.- Parameters:
action
- the action to call
-
getHeaderNames
Returns an iterable with all the names of the headers set.- Returns:
- an iterable view of the header names
-
getHeaders
Returns an iterable of the values of headers with thename
(case-insensitive).- Parameters:
name
- the name of the header, case-insensitive- Returns:
- an iterable view of the values
-
getHeader
Returns the value of the first header with thename
(case-insensitive).- Parameters:
name
- the name of the header, case-insensitive- Returns:
- the value
-
setHeader
Removes all headers with thename
(case-insensitive) and adds a header with thevalue
.- Parameters:
name
- the name of the header, case-insensitivevalue
- the value to set- Returns:
- self
-
addHeader
Adds a header with thename
andvalue
, headers with the same (case-insensitive) name will be preserved.- Parameters:
name
- the name of the header, case-insensitivevalue
- the value to set- Returns:
- self
-
removeHeader
Removes all headers with thename
(case-insensitive).- Parameters:
name
- the name of the header, case-insensitive- Returns:
- self
-
getContentEncoding
-
setContent
Deprecated. -
setContent
-
getContent
-