Skip to content

ServerSentEventStream: decoding support #6867

@mfulton26

Description

@mfulton26

Is your feature request related to a problem? Please describe.

EventSource works well for GET with no custom request headers but does not super other HTTP verbs, request bodies, or custom request headers (e.g. Authorization).

Describe the solution you'd like

I want to be able to use the standard Fetch API and pipe its response body stream into a SSE message decoder so that I'm not limited by EventSource.

The encode/decode functions for server sent event message could also be exported and helpful. (Under @std/encoding?)

Describe alternatives you've considered

Use a package like https://github.com/lukeed/fetch-event-stream or roll it myself. Both of these seem less than ideal though given that @std supports encoding and I'd like to get decoding support from the same instead of relying on two sources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions