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
client doesn't support text/event-stream #998
Comments
This is not supported because the fasthttp Client always waits for the whole response before it returns. With an event stream there is no end to the body so it would never return. You'll have to use |
@erikdubbelboer Is there a possibility to support text/event-stream content type? Or what are the reasons for fasthttp not supporting this ? Thank you |
I'm afraid it's still not possible for the same reason above, that fasthttp always reads the full body. What is your usecase that you need to do this but need the performance of fasthttp? |
Well, we integrated fasthttp in favour of net/http in a reverse proxy for two main reasons. The main reason is, that it does support preserving the header case. An additional benefit is, as you already mentioned, the performance. For us, there are two major caveats with fasthttp, which are:
On the former, there seems to be some progress, but it does not seem to be ready for production use-cases. |
For a while now we have had body streaming for A pull request that adds documentation for this is also welcome. |
I want to request an API with text / event stream return. but I don't get any data by resp.Body(),resp.Body() len = 0.
Actually, the correct return is shown in Charles, what should I do?
Code:
Charles:
The text was updated successfully, but these errors were encountered: