<PackageReference Include="Grpc.Core.Api" Version="2.80.0" />

Grpc.Core.Metadata

A collection of metadata entries that can be exchanged during a call. gRPC supports these types of metadata: Request headersare sent by the client at the beginning of a remote call before any request messages are sent.Response headersare sent by the server at the beginning of a remote call handler before any response messages are sent.Response trailersare sent by the server at the end of a remote call along with resulting call status.
public class Entry

Metadata entry

public const string BinaryHeaderSuffix = "-bin"

All binary headers should have this suffix.

public static readonly Metadata Empty

An read-only instance of metadata containing no entries.

public int Count { get; }

IList<T>

public bool IsReadOnly { get; }

IList<T>

public Entry this[int index] { get; set; }

IList<T>

public Metadata()

Initializes a new instance of Metadata.

public void Add(string key, string value)

Adds a new ASCII-valued metadata entry.

public void Add(string key, byte[] valueBytes)

Adds a new binary-valued metadata entry.

public void Add(Entry item)

IList<T>

public void Clear()

IList<T>

public bool Contains(Entry item)

IList<T>

public void CopyTo(Entry[] array, int arrayIndex)

IList<T>

public Entry Get(string key)

Gets the last metadata entry with the specified key. If there are no matching entries then null is returned.

public IEnumerable<Entry> GetAll(string key)

Gets all metadata entries with the specified key.

IList<T>

public string GetValue(string key)

Gets the string value of the last metadata entry with the specified key. If the metadata entry is binary then an exception is thrown. If there are no matching entries then null is returned.

public byte[] GetValueBytes(string key)

Gets the bytes value of the last metadata entry with the specified key. If the metadata entry is not binary the string value will be returned as ASCII encoded bytes. If there are no matching entries then null is returned.

public int IndexOf(Entry item)

IList<T>

public void Insert(int index, Entry item)

IList<T>

public bool Remove(Entry item)

IList<T>

public void RemoveAt(int index)

IList<T>