Standard library
HTTP response
HTTP response product shape.
Introduction
HTTP response product shape. Import std/net/response to bind the module as response. Call free functions as response.name(...). Struct methods use a receiver value.
/ std/net/response
This page is the package reference for std/net/response. Private helpers used only by co-located tests are not listed.
Struct · response
HTTP response shape and helpers. The shape is exported as response.response. Methods on the receiver are listed next.
/ std/net/response
; shape: response.response
; see std/net/http text_response
Parameters: No parameters. Type or shape export. Returns: Shape export used for literals and methods.
response · set_header
Sets a response header and returns the response for chaining. Call form: response.set_header(name, value).
/ std/net/response
; obtain a response value, then chain headers
$ res = res.set_header("Content-Type", "text/plain")Parameters: name: header name. value: header value. Returns: The response receiver.