Send post data while opening SSE connection
- by Prosto Trader
I'm trying to establish SSE connection and do some long-taking actions on server-side, informing user about how it goes through SSE events.
Actually, I don't understand how would I send some data along with new connection. I have to combine regular ajax with new EventSource or there is a way to transfer post data inside that event?
Here is what I have so far, and I need to send pretty big JSON with the request. Is it possible or the only way to send data is GET?
var source = new EventSource('/terminal/ajax-put-packet-trade-order/');