Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
//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
anyone who already did this?