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.
pull/15223/head
Alex Villarreal7 years agocommitted byJan Tattermusch
/// <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>
publicvoidAdd(stringkey,stringvalue)
{
Add(newEntry(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>
publicvoidAdd(stringkey,byte[]valueBytes)
{
Add(newEntry(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>
publicEntry(stringkey,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>