Skip to content

unable to handle SSE(server-sent events) #484

@CyanChanges

Description

@CyanChanges

Environment

ofetch: 1.4.1
Node.js: N/A

Reproduction

import { ofetch } from 'ofetch'
const resp = await ofetch("https://echo.epb.wiki/_sse", {
	query: { timeout: 3 },
});

Describe the bug

The above code stuck for 3 seconds, but I expect it to return immediately,
and allowing me to process every individual events.

May be adding a hook between send the request and parsing body,
or have some ways to customize body parsing.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions