public GoShipAuthResponse GetToken(string username, string password) { var result = _client.PostAsync("auth/login", null).Result; var content1 = result.Content.ReadAsStringAsync().Result; GoShipAuthResponse returnValue = JsonConvert.DeserializeObject <GoShipAuthResponse>(content1); return(returnValue); }
public GoShipAuthResponse GetGoShipToken(string username, string password) { //string Authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("" + username + "" + ":" + "" + password + "")); using (var goShipLogin = new GoShipLogin ( new Dictionary <string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes("" + username + "" + ":" + "" + password + "")) } } ) ) { GoShipAuthResponse authResponse = goShipLogin.GetToken(username, password); return(authResponse); } }