use of com.canoo.dp.impl.platform.core.http.HttpHeaderConstants.ACCEPT_HEADER in project dolphin-platform by canoo.
the class HttpCallResponseBuilderImpl method readObject.
@Override
public <R> Promise<HttpResponse<R>, HttpException> readObject(final Class<R> responseType) {
Assert.requireNonNull(responseType, "responseType");
connection.addRequestHeader(new HttpHeaderImpl(ACCEPT_CHARSET_HEADER, CHARSET));
connection.addRequestHeader(new HttpHeaderImpl(ACCEPT_HEADER, JSON_MIME_TYPE));
final ResponseContentConverter<R> converter = b -> gson.fromJson(new String(b, CHARSET), responseType);
return createExecutor(converter);
}
Aggregations