Show / Hide Table of Contents

    Class 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.

    Inheritance
    IList<Metadata.Entry>
    Metadata
    Namespace: Grpc.Core
    Assembly: Grpc.Core.Api.dll
    Syntax
    public sealed class Metadata : IList<Metadata.Entry>

    Constructors

    Metadata()

    Initializes a new instance of Metadata.

    Declaration
    public Metadata()

    Fields

    BinaryHeaderSuffix

    All binary headers should have this suffix.

    Declaration
    public const string BinaryHeaderSuffix = null
    Field Value
    Type Description
    System.String

    Empty

    An read-only instance of metadata containing no entries.

    Declaration
    public static readonly Metadata Empty
    Field Value
    Type Description
    Metadata

    Properties

    Count

    IList<>
    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    IsReadOnly

    IList<>
    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean

    Item[Int32]

    IList<>
    Declaration
    public Metadata.Entry this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    Metadata.Entry

    Methods

    Add(Metadata.Entry)

    IList<>
    Declaration
    public void Add(Metadata.Entry item)
    Parameters
    Type Name Description
    Metadata.Entry item

    Add(String, Byte[])

    Adds a new binary-valued metadata entry. See Metadata.Entry constructor for params.

    Declaration
    public void Add(string key, byte[] valueBytes)
    Parameters
    Type Name Description
    System.String key
    System.Byte[] valueBytes

    Add(String, String)

    Adds a new ASCII-valued metadata entry. See Metadata.Entry constructor for params.

    Declaration
    public void Add(string key, string value)
    Parameters
    Type Name Description
    System.String key
    System.String value

    Clear()

    IList<>
    Declaration
    public void Clear()

    Contains(Metadata.Entry)

    IList<>
    Declaration
    public bool Contains(Metadata.Entry item)
    Parameters
    Type Name Description
    Metadata.Entry item
    Returns
    Type Description
    System.Boolean

    CopyTo(Metadata.Entry[], Int32)

    IList<>
    Declaration
    public void CopyTo(Metadata.Entry[] array, int arrayIndex)
    Parameters
    Type Name Description
    Metadata.Entry[] array
    System.Int32 arrayIndex

    GetEnumerator()

    IList<>
    Declaration
    public IEnumerator<Metadata.Entry> GetEnumerator()
    Returns
    Type Description
    IEnumerator<Metadata.Entry>

    IndexOf(Metadata.Entry)

    IList<>
    Declaration
    public int IndexOf(Metadata.Entry item)
    Parameters
    Type Name Description
    Metadata.Entry item
    Returns
    Type Description
    System.Int32

    Insert(Int32, Metadata.Entry)

    IList<>
    Declaration
    public void Insert(int index, Metadata.Entry item)
    Parameters
    Type Name Description
    System.Int32 index
    Metadata.Entry item

    Remove(Metadata.Entry)

    IList<>
    Declaration
    public bool Remove(Metadata.Entry item)
    Parameters
    Type Name Description
    Metadata.Entry item
    Returns
    Type Description
    System.Boolean

    RemoveAt(Int32)

    IList<>
    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Back to top Generated by DocFX