rama creada apartir de master en j
This commit is contained in:
@@ -3,8 +3,18 @@ using System.Text;
|
||||
|
||||
namespace adas_core.module.Relays.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// Utility class for handling HTTP-related operations, such as adding basic authentication headers to HTTP requests.
|
||||
/// </summary>
|
||||
public static class HttpUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds basic authentication to the provided HttpRequestHeaders.
|
||||
/// </summary>
|
||||
/// <param name="username">The username for basic authentication.</param>
|
||||
/// <param name="password">The password for basic authentication.</param>
|
||||
/// <param name="headers">The HttpRequestHeaders to which the authentication will be added.</param>
|
||||
/// <returns>The HttpRequestHeaders with the added basic authentication.</returns>
|
||||
public static HttpRequestHeaders AddBasicAuth(string username, string password, HttpRequestHeaders headers)
|
||||
{
|
||||
var auth = Encoding.ASCII.GetBytes($"{username}:{password}");
|
||||
|
||||
Reference in New Issue
Block a user