Uri address = new Uri("http://localhost:7990/rest/api/1.0/users");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
request.Method = "GET";
request.ContentType = "application/json";
CommandTextBox.Text = request.RequestUri.ToString();
byte[] credentialBuffer = new UTF8Encoding().GetBytes("username:password");
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(credentialBuffer);
No comments:
Post a Comment