COMMUNITY is not posting the message


In flash, we were using the URLStream to send the Post Messages and it was working perfectly.
I have converted the code to Haxe targeting html5.

And I see the Post message in the html5 but this message not received by the server.

Working Example with Postman

not working example using openfl URLStream

our code is

    private function request(x : ByteArray) : Void
        m_stream = new URLStream();
        m_stream.addEventListener(Event.COMPLETE, onComplete);
        m_stream.addEventListener(IOErrorEvent.IO_ERROR, onFatalError);
        m_stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onFatalError);
        m_stream.addEventListener(HTTPStatusEvent.HTTP_STATUS, onProgress);
        m_stream.addEventListener(ProgressEvent.PROGRESS, onProgress);
        m_stream.addEventListener(Event.OPEN, onOpen);
	var theBytes =  com.hurlant.util.ByteArray.fromBytes(Bytes.ofData(x));
	var body : String = Base64.encodeByteArray(x);
        //var body : String = Base64.encodeByteArray(x);
        var request : URLRequest = new URLRequest();
        request.url = m_url;
        request.method = URLRequestMethod.POST;
        request.contentType = "application/json"; = body;
		var header = new URLRequestHeader("Access-Control-Allow-Origin","*");

We tried to send the request using HTTP and it works but it’s sending two requests because of the referrer-policy and it’s doing some problem with our server

	      req = new Http( m_url);
		req.onData = onComplete;
		req.onError = onFatalError;
		req.onStatus = onProgress;
		req.onBytes = onBytes;

Also using the Http is generating some errors like

HttpJs.hx:73 Uncaught TypeError: _gthis.onStatus is not a function at 

XMLHttpRequest.onreadystatechange (HttpJs.hx:73)

| --- | --- | --- | --- |
||XMLHttpRequest.send (async)|||
||XHR.send|@|index.html?v=18980&e…"sandbox": true}:68|

Thanks in advance

Any Help for this

Maybe you can try to publish on OpenFL forum: