mpetazzoni/sse.js

How to catch payload in php?

Closed this issue · 4 comments

I found out that the {payload: value} is not getting into the php file. can you give an example of how to catch POST value into the server via EventSource?

I'm not sure I understand what you're trying to accomplish. Can you describe your situation and problem some more?

var source = new SSE(url, {headers: {'Content-Type': 'text/plain'},
                                      payload: 'Hello, world!',
                                      method: 'GET'});

I just want to say that the value of the payload which is the "Hello World" is not transferring to another page(php). How would to achieve this? already used the var_dump($_GET).

@navjot789 so you run that code in a browser, and you're connecting to a php server? You should debug the network in the browser to see what it sends

Yes, I m successfully connected to the server. Actually I am on localhost.