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
System.Object
    Metadata
  Implements
System.Collections.Generic.IList<Metadata.Entry>
    System.Collections.Generic.ICollection<Metadata.Entry>
    System.Collections.Generic.IEnumerable<Metadata.Entry>
    System.Collections.IEnumerable
  Inherited Members
      System.Object.ToString()
    
    
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
  Namespace: Grpc.Core
Assembly: Grpc.Core.dll
Syntax
public sealed class Metadata : IList<Metadata.Entry>, ICollection<Metadata.Entry>, IEnumerable<Metadata.Entry>, IEnumerableConstructors
Metadata()
Initializes a new instance of Metadata.
Declaration
public Metadata()Fields
BinaryHeaderSuffix
All binary headers should have this suffix.
Declaration
public const string BinaryHeaderSuffix = "-bin"Field Value
| Type | Description | 
|---|---|
| System.String | 
Empty
An read-only instance of metadata containing no entries.
Declaration
public static readonly Metadata EmptyField Value
| Type | Description | 
|---|---|
| Metadata | 
Properties
Count
IList`1
  
  Declaration
public int Count { get; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
IsReadOnly
IList`1
  
  Declaration
public bool IsReadOnly { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
Item[Int32]
IList`1
  
  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`1
  
  Declaration
public void Add(Metadata.Entry item)Parameters
| Type | Name | Description | 
|---|---|---|
| Metadata.Entry | item | 
Add(String, Byte[])
IList`1
  
  Declaration
public void Add(string key, byte[] valueBytes)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | key | |
| System.Byte[] | valueBytes | 
Add(String, String)
IList`1
  
  Declaration
public void Add(string key, string value)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | key | |
| System.String | value | 
Clear()
IList`1
  
  Declaration
public void Clear()Contains(Metadata.Entry)
IList`1
  
  Declaration
public bool Contains(Metadata.Entry item)Parameters
| Type | Name | Description | 
|---|---|---|
| Metadata.Entry | item | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
CopyTo(Metadata.Entry[], Int32)
IList`1
  
  Declaration
public void CopyTo(Metadata.Entry[] array, int arrayIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| Metadata.Entry[] | array | |
| System.Int32 | arrayIndex | 
GetEnumerator()
IList`1
  
  Declaration
public IEnumerator<Metadata.Entry> GetEnumerator()Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerator<Metadata.Entry> | 
IndexOf(Metadata.Entry)
IList`1
  
  Declaration
public int IndexOf(Metadata.Entry item)Parameters
| Type | Name | Description | 
|---|---|---|
| Metadata.Entry | item | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | 
Insert(Int32, Metadata.Entry)
IList`1
  
  Declaration
public void Insert(int index, Metadata.Entry item)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | |
| Metadata.Entry | item | 
Remove(Metadata.Entry)
IList`1
  
  Declaration
public bool Remove(Metadata.Entry item)Parameters
| Type | Name | Description | 
|---|---|---|
| Metadata.Entry | item | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
RemoveAt(Int32)
IList`1
  
  Declaration
public void RemoveAt(int index)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | 
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()Returns
| Type | Description | 
|---|---|
| System.Collections.IEnumerator | 
Implements
      System.Collections.Generic.IList<T>
  
  
      System.Collections.Generic.ICollection<T>
  
  
      System.Collections.Generic.IEnumerable<T>
  
  
      System.Collections.IEnumerable