Example usage for io.vertx.core.http HttpHeaders CONTENT_ENCODING

List of usage examples for io.vertx.core.http HttpHeaders CONTENT_ENCODING

Introduction

In this page you can find the example usage for io.vertx.core.http HttpHeaders CONTENT_ENCODING.

Prototype

CharSequence CONTENT_ENCODING

To view the source code for io.vertx.core.http HttpHeaders CONTENT_ENCODING.

Click Source Link

Document

Content-Encoding header name

Usage

From source file:com.hubrick.vertx.rest.exception.HttpStatusCodeException.java

License:Apache License

/**
 * Return the response body as a string.
 *
 * @since 3.0.5/*w  w  w .jav  a2 s.co  m*/
 */
public String getResponseBodyAsString() {
    final String contentEncoding = httpClientResponse.headers().get(HttpHeaders.CONTENT_ENCODING);
    return new String(this.responseBody,
            contentEncoding != null ? Charset.forName(contentEncoding) : Charset.forName(DEFAULT_CHARSET));
}