I am using WinRT framework. I have to get JSON response from service URL by passing username and password.
Here is the code I have tried
var credentials = new NetworkCredential("***", "***");
var handler = new HttpClientHandler { Credentials = credentials };
//client.DefaultRequestHeaders.Add("UserID", "****");
//client.DefaultRequestHeaders.Add("Password", "****");
HttpClient client = new HttpClient(handler);
But this throw error
Response status code does not indicate success: 500 (Internal Server Error).
Any help is appreciated.