Example usage for org.springframework.http HttpHeaders ACCEPT_ENCODING

List of usage examples for org.springframework.http HttpHeaders ACCEPT_ENCODING

Introduction

In this page you can find the example usage for org.springframework.http HttpHeaders ACCEPT_ENCODING.

Prototype

String ACCEPT_ENCODING

To view the source code for org.springframework.http HttpHeaders ACCEPT_ENCODING.

Click Source Link

Document

The HTTP Accept-Encoding header field name.

Usage

From source file:org.springframework.cloud.netflix.eureka.http.RestTemplateEurekaHttpClient.java

@Override
public EurekaHttpResponse<Void> register(InstanceInfo info) {
    String urlPath = serviceUrl + "apps/" + info.getAppName();

    HttpHeaders headers = new HttpHeaders();
    headers.add(HttpHeaders.ACCEPT_ENCODING, "gzip");
    headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);

    ResponseEntity<Void> response = restTemplate.exchange(urlPath, HttpMethod.POST,
            new HttpEntity<InstanceInfo>(info, headers), Void.class);

    return anEurekaHttpResponse(response.getStatusCodeValue()).headers(headersOf(response)).build();
}