I just wrote a simple webapi as a test.
http://[MachineName]/MyAPI/api/values
That works.
Now I want to consume that in a console app which is on the same machine.
var client = new WebClient();
string content = client.DownloadString("http://[MachineName]/MyAPI/api/values");
Console.WriteLine(content);
Console.Read();
But I get this error:
The remote server returned an error: (401) Unauthorized.
Somewhere I should set the security and I am missing that I think.