public class HttpHeaders extends Object implements Iterable<HttpHeader>, com.fasterxml.jackson.databind.JsonSerializable
| Constructor and Description |
|---|
HttpHeaders()
Create an empty HttpHeaders instance.
|
HttpHeaders(Iterable<HttpHeader> headers)
Create a HttpHeaders instance with the provided initial headers.
|
HttpHeaders(Map<String,String> headers)
Create a HttpHeaders instance with the provided initial headers.
|
| Modifier and Type | Method and Description |
|---|---|
HttpHeader |
get(String name)
Get the
header for the provided header name. |
Iterator<HttpHeader> |
iterator() |
HttpHeaders |
put(String name,
String value)
Set a header.
|
void |
serialize(com.fasterxml.jackson.core.JsonGenerator jsonGenerator,
com.fasterxml.jackson.databind.SerializerProvider serializerProvider) |
void |
serializeWithType(com.fasterxml.jackson.core.JsonGenerator jsonGenerator,
com.fasterxml.jackson.databind.SerializerProvider serializerProvider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSerializer) |
int |
size()
Gets the number of headers in the collection.
|
Map<String,String> |
toMap()
Get
Map representation of the HttpHeaders collection. |
String |
value(String name)
Get the header value for the provided header name.
|
String[] |
values(String name)
Get the header values for the provided header name.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic HttpHeaders()
public HttpHeaders(Map<String,String> headers)
headers - the map of initial headerspublic HttpHeaders(Iterable<HttpHeader> headers)
headers - the collection of initial headerspublic int size()
public HttpHeaders put(String name, String value)
name - the namevalue - the valuepublic HttpHeader get(String name)
header for the provided header name. Null will be returned if the header isn't found.name - the name of the header to find.public String value(String name)
name - the name of the header to look forpublic String[] values(String name)
name - the name of the header to look forpublic Map<String,String> toMap()
Map representation of the HttpHeaders collection.public Iterator<HttpHeader> iterator()
iterator in interface Iterable<HttpHeader>public void serialize(com.fasterxml.jackson.core.JsonGenerator jsonGenerator,
com.fasterxml.jackson.databind.SerializerProvider serializerProvider)
throws IOException
serialize in interface com.fasterxml.jackson.databind.JsonSerializableIOExceptionpublic void serializeWithType(com.fasterxml.jackson.core.JsonGenerator jsonGenerator,
com.fasterxml.jackson.databind.SerializerProvider serializerProvider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSerializer)
throws IOException
serializeWithType in interface com.fasterxml.jackson.databind.JsonSerializableIOExceptionCopyright © 2019 Microsoft Corporation. All rights reserved.