public final class StringResponseHandler
extends java.lang.Object
implements org.dmfs.httpessentials.client.HttpResponseHandler<java.lang.String>
HttpResponseHandler that returns the response body as a String using the charset given in the content-type if there is any or
falling back to a default charset otherwise.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
UTF8_CHARSET |
| Constructor and Description |
|---|
StringResponseHandler()
A
StringResponseHandler that falls back to "UTF-8" if there is no charset given in the response. |
StringResponseHandler(java.lang.String defaultCharset)
A
StringResponseHandler that falls back to the given charset if there is no charset given in the response. |
StringResponseHandler(java.lang.String defaultCharset,
org.dmfs.httpessentials.types.MediaType defaultMediaType)
A
StringResponseHandler that falls back to the given charset and MediaType if there is no charset given in the response. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
handleResponse(org.dmfs.httpessentials.client.HttpResponse response) |
public static final java.lang.String UTF8_CHARSET
public StringResponseHandler()
StringResponseHandler that falls back to "UTF-8" if there is no charset given in the response.public StringResponseHandler(java.lang.String defaultCharset)
StringResponseHandler that falls back to the given charset if there is no charset given in the response.public StringResponseHandler(java.lang.String defaultCharset,
org.dmfs.httpessentials.types.MediaType defaultMediaType)
StringResponseHandler that falls back to the given charset and MediaType if there is no charset given in the response.