-
Notifications
You must be signed in to change notification settings - Fork 534
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
Add support for testing SSE (Server-Sent Events) #116
Comments
Would like to start working on this issue. Would update with the initial draft of the design sketch in sometime.
|
Sure @mmjsmohit. |
Hi I was looking around for a package to support SSE but the flutter_client_sse No Web Support doesn't support web. The package mentioned by mmjsmohit sse is a dart team package and doesn't support flutter web either. I guess we either need to implement our own. Or use conditional imports |
@WrathOP API Dash is only supported for the following platforms: |
Do we make sse a seperate APIType or just handle it in the http type when the header contains text/event-stream and we just keep the connection alive and showing the list of all the events incoming. |
The image is not opening. Please drag and drop it properly in the comments.
![]()
|
Ok The fact that user can use normal http and still receive a text/event-stream do we then switch him to sse type of api? or we just throw an error ? or just return the first event and close the stream? I was thinking of using http package with streamedResponse only and that sse package is build for a specification of a backend and frontend only and not a general propose package. So finally we are making a different api type and doing it that way not based on the response headers. |
In this case whatever is the default behaviour of http get/post/etc. will happen. Will require no changes in API Dash.
ok. take your call what is best for the project.
cool |
@ashitaprasad can i work on this issue with the same ui layout . |
Sure @Clasherzz. You can try out your approach and check if it works. |
@ashitaprasad the streamed reponse doesn't have acces to request headers unlike normal response. This is true for other sse related packages based on http. So it would be hard for users to get the headers that client adds automatically . We can use http_interceptor(haven't tried it until now) . Or go with dio based packages . For the proposal i am going to go with the http_interceptor. |
In the comment above (#116 (comment)) @ashitaprasad already specified that it will be difficult to determine whether to switch to SSE and stream the response. Hence, the best approach is to let user choose SSE, perform request and stream the response accordingly. |
@animator yes but i am not referring to that . What i mean is that in current http_client after getting response it displays the request headers from the response . This helps to show the headers that where added by the package like user agent and encodings. In streamed Response you can't get that . To overcome it i have to use http_interceptor. I am going with the approach as you have told as my suggested approach failed |
@ashitaprasad @animator I have went through many documentations of sse but didnt find anything related to the Request types that SSE can have. I found GET and POST SSE. In my current i have made it available for all. |
Great we are on the same page. |
Sure will review it. Thanks |
PR videos provided by @Clasherzz API.Dash.2025-04-04.00-57-06-2.mp4API.Dash.2025-04-04.01-01-36-2.mp4 |
Tell us about the task you want to perform and are unable to do so because the feature is not available
SSE is gaining widespread popularity due to LLMs. We should support this feature.
See related discussion point 2 in #112
The text was updated successfully, but these errors were encountered: