After reading this topic you will know the following:
What request and response streaming on Apigee is
When to use request and response streaming
How to enable request and response streaming
What is request and response streaming?
By default, HTTP streaming is disabled and HTTP request and response payloads are written to a buffer in memory before they are processed by the API proxy pipeline. You can change this behavior by enabling streaming. With streaming enabled, request and response payloads are streamed without modification to the client app (for responses) and the target endpoint (for requests).
When should I enable streaming?
If your API proxy handles very large requests and/or responses (for size limits, see What else should I know about streaming), you may want to enable streaming.
What else should I know about streaming?
Message payload size is restricted to 10 MB. In non-streamed requests and responses, exceeding that size results in a protocol.http.TooBigBody error.
Encoded data
When streaming is enabled, Apigee does not encode or decode request or response payloads before sending them to the client connecting to Apigee or a backend target server. See the rows for request.streaming.enabled and response.streaming.enabled in the TargetEndpoint Transport Property Specification table for more information.
How to enable request and response streaming
To enable request streaming you need to add the request.streaming.enabled property to the ProxyEndpoint and TargetEndpoint definitions in the proxy bundle and set it to true. Similarly, set the response.streaming.enabled property to enable response streaming.
You can locate these configuration files in the Apigee UI in the Develop view for your proxy. If you are developing locally, these definition files are in apiproxy/proxies and apiproxy/targets.
This sample shows how to enable both request and response streaming in the TargetEndpoint definition.
API proxy samples on GitHub are easy to download and use.
Sample proxies that feature streaming include:
streaming - Demonstrates an API proxy configured for HTTP streaming.
Edge Callout: Signed URL Generator - Illustrates the best practice of generating a signed URL to access large files instead of trying to stream them in a request/response.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-24 UTC."],[[["This guide explains how to enable request and response streaming in Apigee and Apigee hybrid to handle large payloads that exceed the default 10 MB buffer limit."],["Enabling streaming allows unmodified data transfer for requests and responses between the client app and the target endpoint, bypassing the in-memory buffer."],["Streaming should be enabled when API proxies handle very large requests and responses to avoid `protocol.http.TooBigBody` errors due to the 10 MB buffer size limit."],["While streaming can handle large payloads, Apigee recommends not exceeding 10 MB and using signed URLs for larger files to avoid potential performance issues."],["To enable streaming, set `request.streaming.enabled` and `response.streaming.enabled` to `true` within the `ProxyEndpoint` and `TargetEndpoint` definitions in your proxy bundle."]]],[]]