Thanks for the quick reply!
I went down a similar path without much luck. Here is the code I am using (but I am a C# guy):
HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
req.Timeout = 5000;
req.Method = "GET";
req.ContentType = "text/xml";
req.Headers.Add(HttpRequestHeader.CacheControl, "max-age=0");
req.UserAgent = "Mozilla 4.0";
var noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
req.CachePolicy = noCachePolicy;
string result = null;
using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
{
var reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}
The response I get does not even come back as XML. It looks like:
<!doctype html>\n<html class=\"\">\n<head>\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n <meta name='viewport' content='width=device-width, height=device-height, initial-scale=0.8'>\n <link id=\"prtgfavicon\" rel=\"shortcut icon\" type=\"image/ico\" href=\"/favicon.ico\" />\n <title>Welcome | DWS Network Monitoring System</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/prtgmini.css?prtgversion=14.1.8.1371+__\" media=\"print,screen,projection\" />\n\n \n \n\n \n \n \n</head>\n<body id=\"mainbody\" class=\"systemmenu loginscreen language_en\" onload='onLoad();'>\n\n\r\n\r\n<div id=\"login-container\">\r\n\t<div class=\"header\">\r\n\t\t<span class=\"prtglogo\">\r\n\t\t\t<img border=0 id=\"prtgname\" src=\"/images/prtg_network_monitor.png\">\r\n\t\t</span>\r\n\t\t<span class=\"paesslerlogo\">\r\n\t\t\t<a href=\"https://www.paessler.com\" target=\"_blank\" tit
le=\"Paessler AG - The Network Monitoring Company\"><img border=0 id=\"paesslerlogo\" src=\"/images/paessler.png\"></a>\r\n\t\t</span>\r\n\t</div>\r\n\r\n\t<div class=\"login-form\" style=\"\">\r\n\t\t<div class=\"login-cell\">\r\n\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>\r\n\t\t\r\n\t\t\t\t\t<h1>DWS Network Monitoring System</h1>\r\n\r\n<noscript>\r\n <div style=\"margin-bottom:10px\">\r\n <div class=\"nagscreen-box\" >\r\n <p class=\"nagscreen-head\">\r\n Javascript not available!\r\n </p>\r\n <p class=\"nagscreen-cell\">\r\n You cannot use the AJAX Web Interface without Javascript. <br>It seems to be disabled or this browser does not support Javascript.\r\n </p>\r\n </div>\r\n </div>\r\n</noscript>\r\n\t\t\t\t\t<div id=\"unsupportedbrowser\" style=\"margin-bottom:10px;display:none;\">\r\n\t\t\t\t\t\t<div class=\"nagscreen-box\" >\r\n\t\t\t\t\t\t <p class=\"nagscreen-head
\">\r\n\t\t\t\t\t\t Sorry, your browser is not supported!\r\n\t\t\t\t\t\t </p> ETC...
This doesn't seem right? Calling environment is VS2013 console application on Windows 8.1.
I can utilize the same URL in PostMan (REST service utility) within Chrome and get the proper results back. I don't understand what the difference between calls in PostMan and the calls from VS.
Any help is appreciated. THANKS!
Add comment