mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-28 19:50:49 +00:00
Merge pull request #3407 from lunat/csharp_api_key_header_issue_3295
Csharp api key header issue 3295
This commit is contained in:
commit
d16b761aaf
@ -158,9 +158,36 @@ namespace {{packageName}}.Client
|
||||
/// <returns></returns>
|
||||
public void AddDefaultHeader(string key, string value)
|
||||
{
|
||||
if (_defaultHeaderMap.ContainsKey(key))
|
||||
_defaultHeaderMap.Remove(key);
|
||||
_defaultHeaderMap.Add(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add Api Key Header.
|
||||
/// </summary>
|
||||
/// <param name="key">Api Key name.</param>
|
||||
/// <param name="value">Api Key value.</param>
|
||||
/// <returns></returns>
|
||||
public void AddApiKey(string key, string value)
|
||||
{
|
||||
if (ApiKey.ContainsKey(key))
|
||||
ApiKey.Remove(key);
|
||||
ApiKey.Add(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the API key prefix.
|
||||
/// </summary>
|
||||
/// <param name="key">Api Key name.</param>
|
||||
/// <param name="value">Api Key value.</param>
|
||||
public void AddApiKeyPrefix(string key, string value)
|
||||
{
|
||||
if (ApiKeyPrefix.ContainsKey(key))
|
||||
ApiKeyPrefix.Remove(key);
|
||||
ApiKeyPrefix.Add(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP user agent.
|
||||
/// </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user