We are currently experiencing an issue with response streaming in our application. Below are the details:
Application Framework: Flask app with Gunicorn
Deployment Platform: Cloud Run
Gateway Service: APIGEE (streaming enabled)
From the code perspective, we are using yield to stream responses using stream with context (Flask Streaming) to yield responses. Despite enabling streaming on APIGEE, the response streaming is not functioning as expected.
Weird thing is it works on POSTMAN and doesn’t works on browser with react app, calling that api or cURL.
This feature is critical for our application, and we need your assistance to resolve this issue on priority. Please investigate and revert back as soon as possible.
Thank you for your prompt attention to this matter.
We are going to need to look a little closer at the specific errors you are seeing with the different tools and the behavior you are seeing on Apigee to try to uncover this.
To start, please confirm which clients are working and which are not. In the original post above, I think I read it is:
Postman: works
React App: doesn’t work
cURL: doesn’t work
Therefore, please answer a few questions:
Is the observed behavior in Apigee’s debug for each of the 3 clients the same? Same Flow and error / no-error, and response status codes?
When using cURL with --verbose, what errors are you seeing?
When using React App, when errors are shown in the Console and what is shown on the Network view for the call?
What protocol is being used with Flask? I see in a search that Flask has multiple options. Many of these are for video and I suspect are binary. If you know whether the payload is binary or not, that would be helpful.
Can you confirm that Postman and the React App are both using the same protocol?
Can you confirm that there are no policies in Apigee that are trying to touch / manipulate the payload?