/// <summary> /// Adds an authorization header to the <see cref="ISolidHttpRequest"/>. /// </summary> /// <param name="request">The <see cref="ISolidHttpRequest" /> that is being extended.</param> /// <param name="userName">The user name to be used in Basic authentication.</param> /// <param name="password">The password to be used in Basic authentication.</param> /// <returns>The <see cref="ISolidHttpRequest" /> so that additional calls can be chained.</returns> public static ISolidHttpRequest WithBasicAuthorizationHeader(this ISolidHttpRequest request, string userName, string password) => request.WithAuthorizationHeader("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes($"{userName}:{password}")));
/// <summary> /// Adds an authorization header to the <see cref="ISolidHttpRequest"/>. /// </summary> /// <param name="request">The <see cref="ISolidHttpRequest" /> that is being extended.</param> /// <param name="token">The token to use in the authorization header.</param> /// <returns>The <see cref="ISolidHttpRequest" /> so that additional calls can be chained.</returns> public static ISolidHttpRequest WithBearerAuthorizationHeader(this ISolidHttpRequest request, string token) => request.WithAuthorizationHeader("Bearer", token);