Closed systemview2018 closed 6 months ago
@systemview2018
Server-Sent-Events was created to GET streamed information from server. If you wanna POST something - use basic HTTP requests
Yeah, I think this needs more information and rationale. I'm assuming you mean to open an SSE connection through a POST request. But, browser's EventSource do not support this, so it seems like an odd thing to want.
Also, it's posed as a question, not an issue, which suggests to me you haven't even tried it. Surely, you can change GET
to POST
on your endpoint and tell us if it works or not.
Streaming SSE in response to POST is a very common extension used by:
And supported by various extended EventSource packages (which also extend EventSource in other ways, like allowing sending Authorization headers):
Also, it's posed as a question, not an issue, which suggests to me you haven't even tried it. Surely, you can change
GET
toPOST
on your endpoint and tell us if it works or not.
aiohttp-sse
explicitly restricts all methods except GET on prepare
https://github.com/aio-libs/aiohttp-sse/blob/a8ef551ea6185c3a4f52d98f94d6d1911fe1c39d/aiohttp_sse/__init__.py#L62-L63
Default EventSource
client can't connect with other methods, but custom clients can (example). We just need to release restrictions and give this responsibility to developer. If they want to use library this way - why not? :)
aiohttp-sse
explicitly restricts all methods except GET on prepare
Hmm, it's not clear why that check was added: https://github.com/aio-libs/aiohttp-sse/commit/16f188464771b42751300bbfa736ec85be943545
The commit appears to be completely unrelated. If it's just a case of skipping a check, then I think it'd be fine to support it.
+1