Package com.dynatrace.openkit.api.http
Interface HttpRequest
-
- All Known Implementing Classes:
HttpRequestHttpURLConnectionAdapter
public interface HttpRequestInterface representing an HTTP request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetHeader(java.lang.String name)Gets the header's value.java.util.Map<java.lang.String,java.util.List<java.lang.String>>getHeaders()Gets an immutable map containing the request headers and their values.java.lang.StringgetMethod()Gets the HTTP request method.java.net.URLgetUrl()Gets the HTTP requestURL.voidsetHeader(java.lang.String name, java.lang.String value)Sets an HTTP header or overwrites an existing HTTP header with new value.
-
-
-
Method Detail
-
getUrl
java.net.URL getUrl()
Gets the HTTP requestURL.
-
getMethod
java.lang.String getMethod()
Gets the HTTP request method.
-
getHeaders
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
Gets an immutable map containing the request headers and their values.
-
getHeader
java.lang.String getHeader(java.lang.String name)
Gets the header's value.- Parameters:
name- Header name for which to retrieve the value.- Returns:
- The header's value, which might also be
nullif not set.
-
setHeader
void setHeader(java.lang.String name, java.lang.String value)Sets an HTTP header or overwrites an existing HTTP header with new value.Trying to set an HTTP header with null name will return immediately. Trying to set one of the following restricted headers will also return immediately.
Access-Control-Request-HeadersAccess-Control-Request-MethodConnectionContent-LengthContent-Transfer-EncodingHostKeep-AliveOriginTrailerTransfer-EncodingUpgradeVia
- Parameters:
name- The header's name, which must not benullor any of the restricted headers.value- The header's value
-
-