respond
Terminates the pipeline. Sets the status, headers, and body. No step after respond runs once it fires.
Declaration
Attributes
Serialization
- If
Content-Typeis absent, hclapi setsapplication/jsonand JSON-encodesbody. - If a custom content type is provided and
bodyis a string or byte slice, the raw payload is written. - Header names and values are sanitized to remove carriage-return and newline characters, preventing response-splitting attacks.