Example usage for org.springframework.http HttpHeaders getValuesAsList

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

Introduction

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

Prototype

public List<String> getValuesAsList(String headerName) 

Source Link

Document

Return all values of a given header name, even if this header is set multiple times.

Usage

From source file:io.pivotalservices.wiretaprouteservice.CatchAllController.java

private static void printHeaders(String type, HttpHeaders headers) {
    StringBuilder sb = new StringBuilder(type + " HEADER ");
    sb.append(System.lineSeparator());

    for (String key : headers.keySet()) {
        List<String> values = headers.getValuesAsList(key);
        sb.append("KEY: " + key + " VALUES: ");

        for (String value : values) {
            sb.append(value + "; ");
        }/*w w w .j  av a2 s  . com*/
        sb.append(System.lineSeparator());
    }
    logger.debug(sb.toString());
}