Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support non-GET method and request body in the sse client #153

Open
munisystem opened this issue Feb 18, 2023 · 2 comments · May be fixed by #164
Open

Feature Request: Support non-GET method and request body in the sse client #153

munisystem opened this issue Feb 18, 2023 · 2 comments · May be fixed by #164

Comments

@munisystem
Copy link

munisystem commented Feb 18, 2023

Hi, thanks share great library.

I have to use the server-sent event client that to requests non-GET method and request body. But It seems to me that this library does not support. For this I patched this and be using it.

From what I understand, there are the server-sent events used on HTTP endpoints with methods other than GET. For example, in OpenAI's public API, they require the use of the POST method and request body.

What are your thoughts on supporting this feature? If no problems, I'll be glad to help.

@so2liu
Copy link

so2liu commented Mar 4, 2023

Hi, thanks share great library.

I have to use the server-sent event client that to requests non-GET method and request body. But It seems to me that this library does not support. For this I patched this and be using it.

From what I understand, there are the server-sent events used on HTTP endpoints with methods other than GET. For example, in OpenAI's public API, they require the use of the POST method and request body.

What are your thoughts on supporting this feature? If no problems, I'll be glad to help.

maybe this?

https://grciuta.medium.com/server-sent-events-with-go-server-and-client-sides-6812dca45c7

@Southclaws
Copy link

Southclaws commented Dec 29, 2024

I've just run into this too, and I thought it was a spec thing but after a bunch of digging it appears the SSE spec does not mention anything about method constraints which implies any (logical) HTTP method is valid for initiating an SSE stream.

Unfortunately the API I'm talking to is not mine so I can't change it to use GET (which is what EventSource on the browser side uses, which seems to have set a precedent for SSE to appear "GET-only") so I'd like to see a method option added to the client constructor such as in this PR: #184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants