16-11-20 02:46 PM
Thanks.
var _data = new Data();
var userName = _username;
var password = _password;
var credentials = new NetworkCredential(userName, password);
using (var httpClient = new HttpClient(new HttpClientHandler { Credentials = credentials }))
{
httpClient.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata=verbose"));
var response = await httpClient.GetAsync(endpointUrl2);
if (response.IsSuccessStatusCode)
{
string apiResponse = await response.Content.ReadAsStringAsync();
_data = JsonConvert.DeserializeObject<Data>(apiResponse);
}
}
11-10-22 04:19 PM