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

Streaming HTTP query support #859

Open
Karakatiza666 opened this issue Aug 3, 2024 · 3 comments
Open

Streaming HTTP query support #859

Karakatiza666 opened this issue Aug 3, 2024 · 3 comments
Labels
feature 🚀 New feature or request info needed ❓ Further information is required

Comments

@Karakatiza666
Copy link

Description

I am using @hey-api/client-fetch client.
I don't know if I'm missing something, but when I try to make a POST request that results in an HTTP stream (not SSE, just stream of data I'd like to read via requestResult.response.body : ReadableStream) the request's Promise doesn't resolve (apparently because it waits for stram to end - I can see via backend the connection is successfully established). When calling plain fetch this works as expected - request Promise resolves and I can read the body stream. Is there a solution/workaround currently for this?

@Karakatiza666 Karakatiza666 added the feature 🚀 New feature or request label Aug 3, 2024
@mrlubos
Copy link
Member

mrlubos commented Aug 3, 2024

@Karakatiza666 are you able to create a StackBlitz example so we can debug this?

@Karakatiza666
Copy link
Author

Unfortunately now I don't really have the time to work on reproduction, hopefully I'll post something within a week

@mrlubos mrlubos added the info needed ❓ Further information is required label Aug 4, 2024
@jpenna
Copy link

jpenna commented Sep 19, 2024

Same problem here.

I'm using the axios client. You can see they have an example of how to work with streaming data in their docs: https://github.com/axios/axios?tab=readme-ov-file#axiosconfig

My code is doing exactly what they are showing, but I get the following warning from the browser:

The provided value 'stream' is not a valid enum value of type XMLHttpRequestResponseType.

await summarize({ path: { id }, responseType: 'stream' }).then((response) => {
    response.data.on('data', (data) => {
      console.log('axios', data); // nothing is printed
    });
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 New feature or request info needed ❓ Further information is required
Projects
None yet
Development

No branches or pull requests

3 participants