<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox]]></title><description><![CDATA[<p dir="auto">I've run into a strange problem that has a lot to do with specific web browsers. My public dashboard has a chart that displays data from a data point, which works fine. It also has a download button that uses excel-reports\run to create a new report and then download it when it is ready. For some reason there is no problems with Firefox, but it gives (GET <a href="http://localhost:8080/rest/v1/excel-reports/run/XLT_211607" rel="nofollow ugc">http://localhost:8080/rest/v1/excel-reports/run/XLT_211607</a> 406 (Not Acceptable)) with google chrome. It doesn't work with IE either, but it seems to omit the 406 error and just gives an (Unable to get property 'id' of undefined or null reference) error which is a direct result of the http get not going through.</p>
<p dir="auto">Here is the code I'm using to send the http get</p>
<pre><code>			function createReport(theUrl, callback, option){
				var runReport = new XMLHttpRequest();
				runReport.onreadystatechange = function() { 
					if (runReport.readyState == 4 &amp;&amp; runReport.status == 200)
						var object = JSON.parse(runReport.responseText);
						callback('http://localhost:8080/rest/v1/excel-reports/'+ object["id"], option);
				}
				runReport.open("GET", theUrl, true); // true for asynchronous 
				runReport.send(null);
</code></pre>
]]></description><link>https://forum.mango-os.com/topic/2196/excel-reports-run-http-get-gives-error-406-with-google-chrome-and-ie-works-fine-with-firefox</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 00:00:32 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/2196.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Mar 2016 00:46:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox on Tue, 05 Apr 2016 22:02:40 GMT]]></title><description><![CDATA[<p dir="auto">Glad you got it going! Our support of IE is mixed (it should work, but it's not the target), so I may not be extremely helpful uncovering its idiosyncrasies.</p>
]]></description><link>https://forum.mango-os.com/post/11391</link><guid isPermaLink="true">https://forum.mango-os.com/post/11391</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Tue, 05 Apr 2016 22:02:40 GMT</pubDate></item><item><title><![CDATA[Reply to Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox on Tue, 05 Apr 2016 16:29:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nyoa" aria-label="Profile: nyoa">@<bdi>nyoa</bdi></a></p>
<p dir="auto">Okay I got chrome working now. It seems that the requests were not acceptable because the Accept: condition was any/any and it was supposed to be 'application/json'</p>
<p dir="auto">I just had to add a line of code in function(verifyReport)</p>
<pre><code>verifyRequest.setRequestHeader("Accept","application/json");
</code></pre>
<p dir="auto">There is still some problems with IE however, but I need to get the developer tools work correctly before I can start troubleshooting that.</p>
]]></description><link>https://forum.mango-os.com/post/11390</link><guid isPermaLink="true">https://forum.mango-os.com/post/11390</guid><dc:creator><![CDATA[nyoa]]></dc:creator><pubDate>Tue, 05 Apr 2016 16:29:10 GMT</pubDate></item><item><title><![CDATA[Reply to Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox on Tue, 05 Apr 2016 16:19:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a></p>
<p dir="auto">Thanks a bunch this made things a lot clearer to me. It appears that when I changed the locahlost:8080 to serverip:8080 it confused the browser to not send any cookies created for localhost when sending requests to serverip. Now everything works for firefox browsers again and chrome can send excel-reports/run request successfully. However now I get a 406 error when trying to get report status with  get /v1/excel-reports/{id}.</p>
<p dir="auto">Here is the piece of code responsible for this request.</p>
<pre><code>			function verifyReport(theUrl){
				var verifyRequest = new XMLHttpRequest();
				verifyRequest.onreadystatechange = function() { 
					if (verifyRequest.readyState == 4 &amp;&amp; verifyRequest.status == 200)
						var object = JSON.parse(verifyRequest.responseText);
						if (object["state"]=="FINISHED"){
								document.getElementById("loading_gif").style.visibility = "hidden";
								document.getElementById('download_frame').src = 'http://192.168.0.101:8080/rest/v1/excel-reports/download/'+ object["xid"];
								verifyRequest.open("DELETE",'http://192.168.0.101:8080/rest/v1/excel-reports/' + object["id"], true);
								console.log(object['id']);
								verifyRequest.send(null);
						}else{
							verifyReport('http://192.168.0.101:8080/rest/v1/excel-reports/'+ object["id"]);
						}
				}
				verifyRequest.open("GET", theUrl, true); 
				verifyRequest.send(null);
			};
</code></pre>
<p dir="auto">Here is a picture of the not acceptable header</p>
<p dir="auto"><img src="/forum/uploads/files/1459872667422-badrequest.png" alt="0_1459872667129_badrequest.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/11389</link><guid isPermaLink="true">https://forum.mango-os.com/post/11389</guid><dc:creator><![CDATA[nyoa]]></dc:creator><pubDate>Tue, 05 Apr 2016 16:19:05 GMT</pubDate></item><item><title><![CDATA[Reply to Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox on Tue, 05 Apr 2016 05:30:19 GMT]]></title><description><![CDATA[<p dir="auto">Yes you must use the X-Xsrf-Token header. The value for this header is provided when you login, in a Set-Cookie header in the response. A 403 is an authorization issue. You can also pass that value in the Cookie header, as in your first image.</p>
]]></description><link>https://forum.mango-os.com/post/11387</link><guid isPermaLink="true">https://forum.mango-os.com/post/11387</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Tue, 05 Apr 2016 05:30:19 GMT</pubDate></item><item><title><![CDATA[Reply to Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox on Sat, 02 Apr 2016 15:56:31 GMT]]></title><description><![CDATA[<p dir="auto">I'll paste pictures of both requests here. Is my way of creating and sending the requests correct or could it be done differently?</p>
<p dir="auto">EDIT: I tried the download with another computer in the same network and the error was a bit different. It was net::ERR_CONNECTION_REFUSED.</p>
<p dir="auto">So the situation now is that I get error 406 when trying to use http get with the server computer, and connection refused when other machines try to use it. Is it possible that it is caused by the settings of my mango server?</p>
<p dir="auto">ESIT 2: I changed the target url from localhost:8080 to serverip:8080 and the error changed to 403 access denied (This happened for all the browsers including firefox). I compared my request to a request send from the swagger UI and noticed that the one send from swagger had an X-Xsrf-Token. Is this required to send http requests to the mango server? And if it is, how do I create it on my page for the authenticated user?</p>
<p dir="auto">The first is for firefox.</p>
<p dir="auto"><img src="/forum/uploads/files/1459608427772-headers_firefox.png" alt="0_1459608426307_headers_firefox.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">And the second is for Chrome.</p>
<p dir="auto"><img src="/forum/uploads/files/1459608449617-headers_chrome.png" alt="0_1459608448487_Headers_chrome.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/11380</link><guid isPermaLink="true">https://forum.mango-os.com/post/11380</guid><dc:creator><![CDATA[nyoa]]></dc:creator><pubDate>Sat, 02 Apr 2016 15:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox on Fri, 01 Apr 2016 13:44:52 GMT]]></title><description><![CDATA[<p dir="auto">Well, a 406 Error is a malformed request. I would compare the outgoing HTTP frames in the Chrome / Firefox network tab in the developer tools and see if the browse is making some assumption that is preventing it from working in that context. Perhaps a header like the content encoding is being set differently?</p>
]]></description><link>https://forum.mango-os.com/post/11376</link><guid isPermaLink="true">https://forum.mango-os.com/post/11376</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Fri, 01 Apr 2016 13:44:52 GMT</pubDate></item><item><title><![CDATA[Reply to Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox on Fri, 01 Apr 2016 13:09:25 GMT]]></title><description><![CDATA[<p dir="auto">I construct theUrl when one clicks the download button. The strangest thing is that it works fine when using Firefox but gives the error with Chrome and IE</p>
<pre><code>document.getElementById("DownloadXml").onclick = function (){createReport('http://localhost:8080/rest/v1/excel-reports/run/XLT_211607',verifyReport)};
</code></pre>
]]></description><link>https://forum.mango-os.com/post/11375</link><guid isPermaLink="true">https://forum.mango-os.com/post/11375</guid><dc:creator><![CDATA[nyoa]]></dc:creator><pubDate>Fri, 01 Apr 2016 13:09:25 GMT</pubDate></item><item><title><![CDATA[Reply to Excel-reports&#x5C;run http get gives error 406 with google chrome and IE, works fine with firefox on Thu, 31 Mar 2016 20:41:34 GMT]]></title><description><![CDATA[<p dir="auto">Hmm. I seem to be able to navigate to a /rest/v1/excel-reports/run/XLT_176860 on one of my systems in both browsers. Can you show us where you construct that URL, "theUrl"?</p>
]]></description><link>https://forum.mango-os.com/post/11373</link><guid isPermaLink="true">https://forum.mango-os.com/post/11373</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 31 Mar 2016 20:41:34 GMT</pubDate></item></channel></rss>