I am trying to consume REST API from my .NET Application. This API\'s are all written in JAVA. I am asked to pass the authentication credentials vis HTTP headers. How can I pass
Update
This library has now been replaced by http://nuget.org/packages/Microsoft.Net.Http/2.1.10
Use the Microsoft.Http client library that is in WCF REST Starter Kit Preview 2.
Here is how you could use it:
var client = new HttpClient();
client.DefaultHeaders.Authorization = new Credential("ArbitraryAuthHeader");
client.DefaultHeaders.Date = DateTime.Now;
client.DefaultHeaders.Accept.Add("application/xml");
var response = client.Get("http://example.org");
var xmlString = response.Content.ReadAsString();