Haxe version: 4.0.0-rc.1
So I am trying to request data from a website but the returned data is erroneous and I can’t replicate the same situation on apitester.com or with other tools(browser/curl).
Here is the code:
var request:haxe.Http; request = new haxe.Http("http://www.parl.ca/LegisInfo/Home.aspx?ParliamentSession=42-1&Language=E&download=xml") request.onData = updateDB; request.onError = error; request.onStatus = status;
function status I get status 302 which is Found but the data I get is a redirect to an error page i.e.:
<html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="%2fLegisInfo%2fhttp-500.error%3faspxerrorpath%3d%2fLegisInfo%2fHome.aspx">here</a>.</h2> </body></html>
When I use the browser it downloads the file and when using curl I can get the xml data. I tried connecting directly with a socket and then doing a customrequest to no avail.