NATS .NET Client
1.1.4
The NATS.io .NET C# Client
|
Inherits IEnumerable.
Public Member Functions | |
MsgHeader () | |
MsgHeader (MsgHeader header) | |
void | Add (string name, string value) |
void | Set (string name, string value) |
void | Remove (string name) |
void | Clear () |
string[] | GetValues (string name) |
string | GetFirst (string name) |
string | GetLast (string name) |
IEnumerator | GetEnumerator () |
Static Public Attributes | |
const string | Status = "Status" |
const string | Description = "Description" |
Properties | |
IEnumerable | Keys [get] |
int | Count [get] |
string | this[string name] [get, set] |
The MsgHeader class provides key/value message header support similar to HTTP headers.
Keys and values may only contain printable ASCII character values and cannot contain :
. Concurrent access may result in undefined behavior.
Setting a header field in a message:
Getting a header field from a message:
To set multiple values:
Get multiple values:
NATS.Client.MsgHeader.MsgHeader | ( | MsgHeader | header | ) |
void NATS.Client.MsgHeader.Add | ( | string | name, |
string | value | ||
) |
Add a header field with the specified name and value.
name | Name of the header field. |
value | Value of the header field. |
IEnumerator NATS.Client.MsgHeader.GetEnumerator | ( | ) |
Returns an enumerator that iterates through the message header keys.
string NATS.Client.MsgHeader.GetFirst | ( | string | name | ) |
Gets the first value for the specific key. Will be null if the key is not found
name |
string NATS.Client.MsgHeader.GetLast | ( | string | name | ) |
Gets the last value for the specific key. Will be null if the key is not found
name |
string[] NATS.Client.MsgHeader.GetValues | ( | string | name | ) |
Gets all values of a header field.
name |
void NATS.Client.MsgHeader.Remove | ( | string | name | ) |
Remove a header entry.
name | Name of the header field to remove. |
void NATS.Client.MsgHeader.Set | ( | string | name, |
string | value | ||
) |
Sets the value of a message header field.
name | Name of the header field to set. |
value | Value of the header field. |
|
getset |
Gets or sets the string entry with the specified string key in the message header.
name | The string key of the entry to locate. The key cannot be null, empty, or whitespace. |