public class SimpleHttpResponse
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SimpleHttpResponse.SimpleHttpResponseBuilder |
Modifier and Type | Field and Description |
---|---|
static SimpleHttpResponse |
EMPTY_RESPONSE |
Modifier and Type | Method and Description |
---|---|
void |
close() |
byte[] |
getBytes()
Returns the body contents as a byte array
|
java.lang.String |
getCharacterSet()
Returns the character set of the response, if known, null otherwise
|
java.lang.String |
getContentType()
Returns the content type of the response, if known, null otherwise
|
java.io.InputStream |
getInputStream()
Returns the input stream that can be used to read the response content
|
int |
getLength()
Returns the length of the response, if known, or -1 if unknown.
|
java.lang.String |
getResponseAsString()
Returns the body contents as a
String |
int |
getStatusCode()
Returns the status code of the response
|
java.lang.String |
toString() |
@Nullable public static final SimpleHttpResponse EMPTY_RESPONSE
public java.io.InputStream getInputStream()
java.lang.IllegalStateException
- If a call to getBytes has already been issued on this response@NotNull public byte[] getBytes() throws java.io.IOException
java.io.IOException
- If there is an error reading the input streamjava.lang.IllegalStateException
- If the input stream has already been retrieved (meaning we have no guarantee the bytes are complete)@NotNull public java.lang.String getResponseAsString() throws java.io.IOException
String
String
.java.io.IOException
- If there is an error reading the input streamjava.lang.IllegalStateException
- If the input stream has already been retrieved (meaning we have no guarantee the bytes are complete)public int getLength()
public int getStatusCode()
public java.lang.String getCharacterSet()
public java.lang.String getContentType()
public void close() throws java.io.IOException
java.io.IOException
@NotNull public java.lang.String toString()
toString
in class java.lang.Object