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

Support Request / Response progress #45

Open
acidjazz opened this issue Dec 25, 2021 · 22 comments
Open

Support Request / Response progress #45

acidjazz opened this issue Dec 25, 2021 · 22 comments
Labels
enhancement New feature or request

Comments

@acidjazz
Copy link

I know fetch itself didn't have it for a while, last I recall it was coming in 2020 with some command like

allowHTTP1ForStreamingUpload

Do we have any recommendations on what people might want to use for nuxt3?

@bf

This comment was marked as off-topic.

@kissu

This comment was marked as off-topic.

@mohammedmoutawakkil

This comment was marked as off-topic.

@PhE

This comment was marked as off-topic.

@capoia

This comment was marked as off-topic.

@nickchomey
Copy link

nickchomey commented Dec 1, 2022

It seems this should now be possible with Chromium versions > 105. It would be cool if it could be integrated into ofetch!

https://developer.chrome.com/articles/fetch-streaming-requests/#streaming-request-bodies
fetch() upload streaming - Chrome Platform Status (chromestatus.com)

Here's an example implementation: https://stackoverflow.com/a/52860605/19510854

@NozomuIkuta NozomuIkuta added enhancement New feature or request upstream and removed upstream labels Jan 11, 2023
@4KDA

This comment was marked as off-topic.

@pi0 pi0 mentioned this issue Aug 23, 2023
@pi0 pi0 changed the title Any examples/support for a progress handler? Support Request / Response progress Aug 23, 2023
@pi0 pi0 mentioned this issue Sep 21, 2023
1 task
@Dmytro-Tihunov

This comment was marked as off-topic.

@acidjazz

This comment was marked as off-topic.

@cdwmhcc
Copy link

cdwmhcc commented Nov 7, 2023

@alirayaneh

This comment was marked as off-topic.

@ademyalcin27

This comment was marked as off-topic.

@clinton9ice

This comment was marked as off-topic.

@sohaha

This comment was marked as off-topic.

@EduardoRocha234

This comment was marked as off-topic.

@Megachill

This comment was marked as off-topic.

@meyt

This comment was marked as off-topic.

@bradley-varol

This comment was marked as off-topic.

@EduardoRocha234

This comment was marked as off-topic.

@pi0
Copy link
Member

pi0 commented Sep 23, 2024

I appreciate the responses and solutions and understand it is a common requirement in frontend applications to track request/response progress when making HTTP calls but please do not respond with repetitive responses, it is an open issue.

ofetch is based on fetch API that is natively supported in both modern servers and browser runtimes but sadly, the standard spec does not allow tracking requests and responses (it is not a limitation of ofetch.)

There are currently two solutions:

  • Using an alternative method for making HTTP requests (XHR in browsers / HTTP module in node)
  • Using native fetch and wrapper around request and response streams as proposed in feat: add support for Request / Response progress #277 ( request streaming is not possible in all browsers/http servers).

@bradley-varol

This comment was marked as off-topic.

@pi0

This comment was marked as off-topic.

@unjs unjs locked and limited conversation to collaborators Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests