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.
Assembly: Grpc.Core.Api.dll
public sealed class Metadata : IList<Metadata.Entry>
Constructors
Initializes a new instance of Metadata
.
Declaration
Fields
All binary headers should have this suffix.
Declaration
public const string BinaryHeaderSuffix = null
Field Value
Type |
Description |
System.String |
|
An read-only instance of metadata containing no entries.
Declaration
public static readonly Metadata Empty
Field Value
Properties
IList<>
Declaration
public int Count { get; }
Property Value
Type |
Description |
System.Int32 |
|
IList<>
Declaration
public bool IsReadOnly { get; }
Property Value
Type |
Description |
System.Boolean |
|
IList<>
Declaration
public Metadata.Entry this[int index] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Property Value
Methods
Add(Metadata.Entry)
IList<>
Declaration
public void Add(Metadata.Entry item)
Parameters
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 |
|
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 |
|
IList<>
Declaration
Contains(Metadata.Entry)
IList<>
Declaration
public bool Contains(Metadata.Entry item)
Parameters
Returns
Type |
Description |
System.Boolean |
|
CopyTo(Metadata.Entry[], Int32)
IList<>
Declaration
public void CopyTo(Metadata.Entry[] array, int arrayIndex)
Parameters
IList<>
Declaration
public IEnumerator<Metadata.Entry> GetEnumerator()
Returns
IndexOf(Metadata.Entry)
IList<>
Declaration
public int IndexOf(Metadata.Entry item)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Insert(Int32, Metadata.Entry)
IList<>
Declaration
public void Insert(int index, Metadata.Entry item)
Parameters
Remove(Metadata.Entry)
IList<>
Declaration
public bool Remove(Metadata.Entry item)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IList<>
Declaration
public void RemoveAt(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|