Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

Connecting to the QRS using a specific NTML account gives 401

//Create the HTTP Request and add required headers and content in xrfkey

string xrfkey = "0123456789abcdef";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://servername.com/QRS/about?xrfkey=" + xrfkey);

request.Method = "GET";

request.UserAgent = "Windows";

request.Accept = "application/json";

request.Headers.Add("X-Qlik-xrfkey", xrfkey);

request.UseDefaultCredentials = false;

request.Credentials = new NetworkCredential("username", "secret");

// make the web request and return the content

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Stream stream = response.GetResponseStream();

Console.WriteLine(new StreamReader(stream).ReadToEnd());

This is my code, but i keep getting a 401 error. Do i need to add another request.?

I tried with request.PreAuthenticate

1 Reply
amien
Specialist
Specialist
Author

anyone who already did this?