Firebase REST API streaming

I cannot get this to work.

<script>
    var urlConnect = 'https://developer-api.nest.com/?auth=CREDENTIAL';
    var source = new EventSource(urlConnect);
    source.onmessage = function (event){
        console.log(event.data);
    };
</script>

      

In my opinion this should create a streaming connection to the Firebase REST API. This is not true.

Firebase documentation says:

set Accept header for client to text / event stream

How to do it?

+3


source to share





All Articles