Closed czechboy0 closed 12 months ago
This is an important topic to cover and something that we are currently discussing in the broader ecosystem. The SSWG is currently gathering requirements for a general purpose HTTP server. One of the key functionalities of this new type is support for full bidirectional streaming. I think we should follow the API design of the general purpose HTTP server here in OpenAPI.
We might need to provide an async body not just for raw byte content types, but also for text/*, as text/event-stream would need that to work.
Either we'll exclude text/event-stream from being returned as String, or we'll need to provide AsyncSequence
For simplicity, initially the type holding the raw request and response body data is
Foundation.Data
, but that prevents use cases where large amounts of data need to be sent/received if the memory limit of the process is low.What should be possible: a uploading/downloading large (multi-GB) files without buffering them into memory on either client/server ends.