Example usage for com.squareup.okhttp.internal.http OkHeaders toMultimap

List of usage examples for com.squareup.okhttp.internal.http OkHeaders toMultimap

Introduction

In this page you can find the example usage for com.squareup.okhttp.internal.http OkHeaders toMultimap.

Prototype

public static Map<String, List<String>> toMultimap(Headers headers, String valueForNullKey) 

Source Link

Document

Returns an immutable map containing each field to its list of values.

Usage

From source file:io.apiman.gateway.platforms.servlet.connectors.ok.HttpURLConnectionImpl.java

License:Apache License

@Override
public final Map<String, List<String>> getHeaderFields() {
    try {// w w w. j  a v a 2s. c o m
        return OkHeaders.toMultimap(getHeaders(), StatusLine.get(getResponse().getResponse()).toString());
    } catch (IOException e) {
        return Collections.emptyMap();
    }
}

From source file:io.apiman.gateway.platforms.servlet.connectors.ok.HttpURLConnectionImpl.java

License:Apache License

@Override
public final Map<String, List<String>> getRequestProperties() {
    if (connected) {
        throw new IllegalStateException("Cannot access request header fields after connection is set");
    }/*from w ww.  j a  va 2  s.  com*/

    return OkHeaders.toMultimap(requestHeaders.build(), null);
}