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 stream response with POST #5806

Closed
lukelu520 opened this issue Jul 31, 2023 · 4 comments
Closed

Support stream response with POST #5806

lukelu520 opened this issue Jul 31, 2023 · 4 comments
Labels
status::wont do/fix This will not be worked on

Comments

@lukelu520
Copy link

lukelu520 commented Jul 31, 2023

Dear axios expert,

axios.post doesn't work with stream response, e.g. gpt stream.
This is a well-known issue since 2016 as in #479

Describe the solution you'd like

make axios works with stream response.

Maybe I am missing something; hope to hear your expertise.

Describe alternatives you've considered

fetch can do it.

@yangxu52
Copy link

The following content has been translated:
1.Axios is based on XHR and packaged as Promise.
2.Axios and Fetch APIs cannot be compared. Fetch is API from Web Woker API.
3.XHR not support stream response, and it stopped updating early on.
So.use anthoer request library which based on Fetch API, or use Fetch directly.

@jasonsaayman
Copy link
Member

we are working on a fetch adaptor for now I will close this but stay tuned

@jasonsaayman jasonsaayman added the status::wont do/fix This will not be worked on label Sep 5, 2023
@uzaymacar
Copy link

Hi @jasonsaayman, thanks for the information. As emphasized in several different issues streaming is a must-have feature for many applications nowadays; is there an ETA on this feature? i.e., are we talking about months or years? Thanks in advance.

@git-syl
Copy link

git-syl commented Oct 12, 2023

My SSE solution is :
https://stackoverflow.com/questions/76334679/how-get-response-in-axios-when-api-is-steam-like-sse-server-send-events

 onDownloadProgress: progressEvent => {
     const xhr = progressEvent.event.target
     const { responseText } = xhr
     console.log("=====responseText======")
     console.log(responseText)
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status::wont do/fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants