1) If no credential supply, will return HTTP 401 and challenge for user/pwd by HTTP header:
WWW-Authenticate: Basic realm=”credential prompt”
2) pass credential by HTTP header:
Authorization: Basic a2x1b0BtaW1lby5jb206MTIzNDU2Nw==
Authorization: Basic base64(username:password)
example:
restRequest.Headers.Add(“Authorization”, “Basic ” + Convert.ToBase64String(Encoding.ASCII.GetBytes(“username:password”)));