public class HttpHeaders extends Object implements Iterable<HttpHeader>, com.fasterxml.jackson.databind.JsonSerializable
| Constructor and Description |
|---|
HttpHeaders()
Create an empty HttpHeaders object.
|
HttpHeaders(Iterable<HttpHeader> headers)
Create a HttpHeaders object with the provided initial headers.
|
HttpHeaders(Map<String,String> headers)
Create a HttpHeaders object with the provided initial headers.
|
| Modifier and Type | Method and Description |
|---|---|
Iterator<HttpHeader> |
iterator() |
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) |
HttpHeaders |
set(String headerName,
String headerValue)
Set the value for the header named headerName,
discarding any value previously added for that header.
|
int |
size()
Get the number of HTTP headers in this collection.
|
Map<String,String> |
toMap()
Convert this HttpHeaders collection to a Map.
|
String |
value(String headerName)
Get the header value for the provided header name.
|
String[] |
values(String headerName)
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 name to value associations to use as initial headers.public HttpHeaders(Iterable<HttpHeader> headers)
headers - The map of name to value associations to use as initial headers.public int size()
public HttpHeaders set(String headerName, String headerValue)
headerName - The name of the header.headerValue - The value of the header.public String value(String headerName)
headerName - The name of the header to look for.public String[] values(String headerName)
headerName - The name of the header to look for.public Map<String,String> toMap()
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.JsonSerializableIOException/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/