Example usage for org.springframework.http HttpEntity EMPTY

List of usage examples for org.springframework.http HttpEntity EMPTY

Introduction

In this page you can find the example usage for org.springframework.http HttpEntity EMPTY.

Prototype

HttpEntity EMPTY

To view the source code for org.springframework.http HttpEntity EMPTY.

Click Source Link

Document

The empty HttpEntity , with no body or headers.

Usage

From source file:org.springframework.vault.authentication.AuthenticationStepsOperator.java

private static HttpEntity<?> getEntity(HttpEntity<?> entity, Object state) {

    if (entity == null) {
        return state == null ? HttpEntity.EMPTY : new HttpEntity<>(state);
    }/*from   w  w  w  .j av  a2s. c  o m*/

    if (entity.getBody() == null && state != null) {
        return new HttpEntity<>(state, entity.getHeaders());
    }

    return entity;
}