public class Response extends Object
| Constructor and Description |
|---|
Response(org.apache.http.HttpResponse r) |
| Modifier and Type | Method and Description |
|---|---|
String |
getContentEncoding() |
org.apache.http.HttpResponse |
getResponse() |
byte[] |
getResponseBody()
Get the body of the response as a byte array
|
ContentLengthInputStream |
getResponseBodyAsStream()
Get the response body as a Stream
|
String |
getResponseBodyAsString()
Returns the response body as text
|
org.apache.http.Header |
getResponseHeader(String headerName)
Returns the specified response header.
|
org.apache.http.Header[] |
getResponseHeaders()
The HTTP headers from the response
|
org.apache.http.Header[] |
getResponseHeaders(String headerName)
Returns the response headers with the given name.
|
int |
getStatusCode()
Get the HTTP status code
|
org.apache.http.StatusLine |
getStatusLine()
The HTTP Status line (both the status code and the status message).
|
String |
getStatusMessage()
Get the HTTP status message
|
public org.apache.http.Header[] getResponseHeaders()
public org.apache.http.StatusLine getStatusLine()
public int getStatusCode()
public String getStatusMessage()
public org.apache.http.HttpResponse getResponse()
public String getResponseBodyAsString() throws IOException
IOException - If an error occurs reading the input streampublic ContentLengthInputStream getResponseBodyAsStream() throws IOException
IOException - If an error occurs reading the input streampublic byte[] getResponseBody()
throws IOException
IOException - If an error occurs reading the input streampublic org.apache.http.Header getResponseHeader(String headerName)
headerName - - The name of the header to be returned.public org.apache.http.Header[] getResponseHeaders(String headerName)
headerName - - the name of the headers to be returned.public String getContentEncoding()
Copyright © 2020. All rights reserved.