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);
urlLoader1.load(request);

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

Access to XMLHttpRequest at ‘[server side file url]’ from origin ‘http://127.0.0.1:3000’ 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) 
{
trace(data);
 }

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

http.request();