public static async Task <T> PostApiWithoutAuthentication <T>(string urlService, string endpoint, string contentRequest) { try { //Create and Load Http Client HttpClient client = LoadHttpClient.GetHttpClient(urlService: urlService); //Post Request return(await PostApiRequest <T>(client, endpoint, contentRequest)); } catch (Exception ex) { throw ex;//return error } }
public static async Task <T> PostApiWithAuthentication <T>(string urlService, string endpoint, string contentRequest, string username, string password) { try { //Create and Load Http Client HttpClient client = await LoadHttpClient.GetHttpClientWithToken(urlService : urlService, username : username, password : password); //Post Request return(await PostApiRequest <T>(client, endpoint, contentRequest)); } catch (Exception ex) { throw ex;//return error } }
public AuthenticationRequest(string urlService) { _client = LoadHttpClient.GetHttpClient(urlService); }