write to stream
This block is part of the http connection group and was last modified in core v10.4.28.
write to stream v10.4.28 Writes part of a response to the client. After the whole response has been streamed, we need to call end stream.
- flow
flow - connection required
httpconnection - code required
numberHTTP Status Code to return on this response.
- type
valueSets the Content-Type HTTP header.
- Headers
array<object>Custom HTTP Headers to set, Array of Objects [{ key: Value, value: Value }]
- Chunk required
valueWrites part of a response to the client. After the whole response has been streamed, we need to call end stream.
- flow
flow - connection
httpconnection
Appends the value pin as the next chunk of a streamed response : call it repeatedly, then finish with httpconnection_set_stream_end, which is what actually flushes. The code, type and headers pins are only applied when set; a falsy value (0, false, "", nil) appends an empty string chunk. This block alone never completes the response.
A typical wiring for write to stream: a function trigger starts the flow; number feeds the code pin; the flow out pin feeds debug.
Version history
Introduced in v10.4.28.
Back to
http connection Return to the main group to view all sub-groups Back to response Return to the group to view all blocks within this group 