Response.toString

Encodes the response into a string. The Content-Length header field is created automatically based on the length of the content field.

class Response
override
string
toString
()

Examples

auto response = new Response(200, [], "Hi");
assert(response.toString() == "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nHi");

Meta