Username/Password , , , (HTTP Basic Authentication), . :
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(@"https://localhost:8010/api/Customer/1");
//Add a header to the request that contains our credentials
//DO NOT HARDCODE IN PRODUCTION!! Pull credentials real-time from database or other store.
string svcCredentials = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes("user1"+ ":" + "test"));
req.Headers.Add("Authorization", "Basic " + svcCredentials);
"WCF", "Web API", . "" , , . , HTTP 401.
WCF REST, IIS, :
REST, IIS
share