kreta/Kreta.Client/FileService/Extension/HeaderExtension.cs
2024-03-13 00:33:46 +01:00

27 lines
947 B
C#

using System.Collections.Generic;
namespace Kreta.Client.FileService.Extension
{
internal static class HeaderExtension
{
public static Dictionary<string, string> GetAuthorizationHeaderWithMulitpartFrom(this string token)
=> new Dictionary<string, string>
{
{ "Content-Type", "multipart/form-data" },
{ "Authorization", $"Bearer {token}" },
};
public static Dictionary<string, string> GetAuthorizationHeaderWithJson(this string token)
=> new Dictionary<string, string>
{
{ "Content-Type", "application/json" },
{ "Authorization", $"Bearer {token}" },
};
public static Dictionary<string, string> GetFormUrlEncodedHeader()
=> new Dictionary<string, string>
{
{ "Content-Type", "application/x-www-form-urlencoded" },
};
}
}