UrlRequest has stopped working. Http is working as alternative

The following method of getting values from server side file seems to have stopped working. It used to work before though.

var request:URLRequest = new URLRequest( "<serverside file method returning values>" );
var variables:URLVariables = new URLVariables();
variables.v1 = 'value1';
request.data = variables ;
request.method = URLRequestMethod.POST ;
var urlLoader1:URLLoader = new URLLoader();urlLoader1.addEventListener(Event.COMPLETE, handleComplete);

Now when I use it to retrieve values this is the error I get:

Access to XMLHttpRequest at ‘[server side file url]’ from origin ‘’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Alternatively this still works

var http = new haxe.Http(<server side file url>);
http.onData = function (data:String) 

http.onError = function (error) {
  trace('error: $error');