Package com.dynatrace.openkit.api.http
Interface HttpResponse
-
- All Known Implementing Classes:
HttpResponseHttpURLConnectionAdapter
public interface HttpResponseInterface representing an HTTP response.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetHeader(java.lang.String name)Gets the value of an HTTP response header.java.util.Map<java.lang.String,java.util.List<java.lang.String>>getHeaders()Gets the HTTP response headers and their values.java.lang.StringgetRequestMethod()Gets the request method associated with this response.java.net.URLgetRequestUrl()Gets the requestURLassociated with this response.intgetResponseCode()Gets the HTTP response code.java.lang.StringgetResponseMessage()Gets the HTTP response message.
-
-
-
Method Detail
-
getRequestUrl
java.net.URL getRequestUrl()
Gets the requestURLassociated with this response.
-
getRequestMethod
java.lang.String getRequestMethod()
Gets the request method associated with this response.
-
getResponseCode
int getResponseCode()
Gets the HTTP response code.If reading the HTTP status line fails,
Integer.MIN_VALUEis returned.- Returns:
- HTTP response code returned by server, or a negative value in case of an error.
-
getResponseMessage
java.lang.String getResponseMessage()
Gets the HTTP response message.If reading the HTTP status line fails,
nullis returned.- Returns:
- HTTP response message returned by server or
null.
-
getHeaders
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
Gets the HTTP response headers and their values.- Returns:
- An immutable map of HTTP response headers mapping to their values.
-
getHeader
java.lang.String getHeader(java.lang.String name)
Gets the value of an HTTP response header.If the header occurs multiple times, it depends on the underlying implementation which value is returned. In this case prefer
getHeaders()instead.- Returns:
- Value associated with HTTP response header
nameornull.
-
-