diff options
author | Alex Villarreal <alex@alexvy86.com> | 2018-04-27 19:34:25 -0500 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2018-09-28 13:25:52 +0200 |
commit | 98bce85cacc8a17a6f6b0d96df3ae2c1d07f5b13 (patch) | |
tree | 83e70b7461f1407208a08cb87e7ee17611a6b010 /src/csharp | |
parent | 5a34293615078d0954e089901a257cdb2bb06b9e (diff) |
Improve documentation to use Metadata.Entry
Add notes about the parameters in public constructors of `Metadata.Entry`, and `Metadata`s `Add` methods (which call the aforementioned constructors), to clearly indicate what a valid key should be, **and the fact that it is converted to lowercase**. Seems like an important enough side effect that it should be explicit in the documentation.
Diffstat (limited to 'src/csharp')
-rw-r--r-- | src/csharp/Grpc.Core/Metadata.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs index a9aa2cbbfc..b59aee7d80 100644 --- a/src/csharp/Grpc.Core/Metadata.cs +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -137,6 +137,8 @@ namespace Grpc.Core /// <summary> /// <see cref="T:IList`1"/> /// </summary> + /// <param name="key">Metadata key. Gets converted to lowercase. Must not use suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores and hyphens.</param> + /// <param name="value">Value string. Only ASCII characters are allowed.</param> public void Add(string key, string value) { Add(new Entry(key, value)); @@ -145,6 +147,8 @@ namespace Grpc.Core /// <summary> /// <see cref="T:IList`1"/> /// </summary> + /// <param name="key">Metadata key. Gets converted to lowercase. Needs to have suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores and hyphens.</param> + /// <param name="valueBytes">Value bytes.</param> public void Add(string key, byte[] valueBytes) { Add(new Entry(key, valueBytes)); @@ -239,7 +243,7 @@ namespace Grpc.Core /// <summary> /// Initializes a new instance of the <see cref="Grpc.Core.Metadata.Entry"/> struct with a binary value. /// </summary> - /// <param name="key">Metadata key, needs to have suffix indicating a binary valued metadata entry.</param> + /// <param name="key">Metadata key. Gets converted to lowercase. Needs to have suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores and hyphens.</param> /// <param name="valueBytes">Value bytes.</param> public Entry(string key, byte[] valueBytes) { @@ -255,7 +259,7 @@ namespace Grpc.Core /// <summary> /// Initializes a new instance of the <see cref="Grpc.Core.Metadata.Entry"/> struct holding an ASCII value. /// </summary> - /// <param name="key">Metadata key, must not use suffix indicating a binary valued metadata entry.</param> + /// <param name="key">Metadata key. Gets converted to lowercase. Must not use suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores and hyphens.</param> /// <param name="value">Value string. Only ASCII characters are allowed.</param> public Entry(string key, string value) { |