HeaderCollection
Namespace: Vercel.AI.Util
public sealed class HeaderCollectionCase-insensitive header list that preserves repeated values such as Set-Cookie.
Inheritance: object
Constructors
Section titled “Constructors”HeaderCollection()
Section titled “HeaderCollection()”public HeaderCollection()Creates an empty collection.
HeaderCollection(IEnumerable<KeyValuePair<string, string>>?)
Section titled “HeaderCollection(IEnumerable<KeyValuePair<string, string>>?)”public HeaderCollection(IEnumerable<KeyValuePair<string, string>>? headers)Copies <code class=“paramref”>headers</code>.
Parameters
| Name | Type | Description |
|---|---|---|
headers |
IEnumerable<KeyValuePair<string, string>> |
Methods
Section titled “Methods”Add(string, string)
Section titled “Add(string, string)”public void Add(string name, string value)Appends one header value.
Parameters
| Name | Type | Description |
|---|---|---|
name |
string | |
value |
string |
Contains(string)
Section titled “Contains(string)”public bool Contains(string name)Returns whether a header with <code class=“paramref”>name</code> is present.
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
Returns: bool
Entries()
Section titled “Entries()”public IReadOnlyList<KeyValuePair<string, string>> Entries()Header entries in insertion order.
Returns: IReadOnlyList<KeyValuePair<string, string>>
Get(string)
Section titled “Get(string)”public string? Get(string name)First value for <code class=“paramref”>name</code>, or null.
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
Returns: string
GetAll(string)
Section titled “GetAll(string)”public IReadOnlyList<string> GetAll(string name)Every value for <code class=“paramref”>name</code>.
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
Returns: IReadOnlyList<string>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product