Response builder
[io/http/server/utils/Response builder]
Builds a response structure out of its components: HTTP status, headers, and body. Example:
200@1 received via
status
{"Content-Type": "text/plain"}@1 received via
headers
"OK"@1 received via
body
{"status": 200, "headers": {"Content-Type": "text/plain"}, "body": "OK"}@1 sent via
response
Keywords: construct, build, response, http, API, text, REST
Input ports
body:
string
Receives the body of the response. Example: "OK"
status:
number
Receives a HTTP status code. Example: 200
headers:
{string: string}
Receives a record of HTTP headers. Example: {"Contanet-Type": "text/plain"}
Output ports
response:
Sends the constructed HTTP response.
Last updated