Skip to content

HTTP recipes ​

Each recipe adds one behavior to a controller or entry point from the HTTP quick start. Import the decorators and context types used in a controller fragment from @chojs/web. The paths in the verification commands assume no controller route or application prefix. If you keep the tutorial's api prefix, add /api to those URLs.

I need to…Start hereVerify with
Deliver records while producing themStream a responsecurl -N
Offer a file with a suggested nameDownload a fileResponse headers and downloaded bytes
Receive a multipart formAccept an uploadcurl -F
Expose a fixed upstream service through a routeForward a requestUpstream status and body
Drain connections before disposing resourcesShut down gracefullyA request active during shutdown

For browser subscriptions with named events and automatic reconnection, use the SSE guide.

Released under the MIT License.