HTML SSE Request Body

When using the EventSource API in JavaScript, is there a way to send the request body along with the HTTP request initiating the polling?

I need to send a large JSON block to the server at the request of SSE so that the server can calculate which events to send to the client. It seems silly to do web sockets when I don't need it, or do weird things with cookies or multiple requests.

I'm worried that I will work with query string length restrictions if I associate data with what is likely to be.

Thanks in advance!

+4
source share
1 answer

SSE HTTP- GET, :

  • , SSE , URL- 255 " ". URL-, IE ~ 2k. ( EventSource IE, XHR polyfill...) , , URL- . .

: URL- ?, Url WebView.loadUrl Android?, http://www.benzado.com/blog/post/28/iphone-openurl-limit

  • cookie, GET. cookie, , SSE, cookie, javascript ( EventSource). cookie 4096 ( cookie, ) 20 cookie . , -, : http://browsercookielimits.x64.me/ cookie.

  • , , , JSON , SSE.

  • , () , GET. . HTTP GET . EventSource URL- .

  • , JSON.

+3

All Articles