You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs/api-platform/antipatterns/payload-with-streaming). info

In Edge, the default behavior is that HTTP request and response payloads are stored in an
in-memory buffer before they are processed by the policies in the API Proxy.

If streaming is enabled, then request and response payloads are streamed without modification to
the client app (for responses) and the target endpoint (for requests). Streaming is useful
especially if an application accepts or returns large payloads, or if there's an application that
returns data in chunks over time.

## Antipattern

Accessing the request/response payload with streaming enabled causes Edge to go back to the
default buffering mode.
![](https://docs.apigee.com/static/api-platform/images/antipatterns/payload-with-streaming.png) **Figure 1**: Accessing request/response payload with streaming enabled

The illustration above shows that we are trying to extract variables from the request payload and
converting the JSON response payload to XML using JSONToXML policy. This will disable the streaming
in Edge.

## Impact

- Streaming will be disabled which can lead to increased latencies in processing the data
- Increase in the heap memory usage or OutOfMemory Errors can be observed on Message Processors due to use of in-memory buffers especially if we have large request/response payloads

## Best practice

- Don't access the request/response payload when streaming is enabled.

## Further reading

- [Streaming requests and responses](https://docs.apigee.com/api-services/content/enabling-streaming)
- [How does APIGEE Edge Streaming work?](https://discuss.google.dev/t/how-does-apigee-edge-streaming-work/8765)
- [How to handle streaming data together with normal request/response payload in a single API Proxy](https://discuss.google.dev/t/how-to-handle-streaming-data-together-with-normal-request-response-payload-in-a-single-api-proxy/11342)
- [Best practices for API proxy design and development](https://docs.apigee.com/api-services/content/best-practices-api-proxy-design-and-development)