01-02-2019, 06:42 PM
Hi, all.
I want to create data text/event-stream for Server Sent Event. I wrote code like this.
but, the results I get are like this.
HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache
Cache-control: no-store, max-age=0, no-cache
Date: Thu, 03 Jan 2019 01:39:01 GMT
data: Hallo:
Can anyone help me, please?
I want to create data text/event-stream for Server Sent Event. I wrote code like this.
PHP Code:
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
echo "Data:test\n\n";
HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache
Cache-control: no-store, max-age=0, no-cache
Date: Thu, 03 Jan 2019 01:39:01 GMT
data: Hallo:
Can anyone help me, please?