HTTPServerResponse.writeBody - multiple declarations
Function HTTPServerResponse.writeBody
Writes the entire response body at once.
void writeBody
(
const(ubyte[]) data,
string content_type = null
) @safe;
void writeBody
(
const(ubyte[]) data,
int status,
string content_type = null
) @safe;
void writeBody
(
scope InputStream data,
string content_type = null
) @safe;
Parameters
Name | Description |
---|---|
data | The data to write as the body contents |
status | Optional response status code to set |
content_type | Optional content type to apply to the response.
If no content type is given and no "Content-Type" header is
set in the response, this will default to
"application/octet-stream" . |
See Also
HTTPStatusCode
Function HTTPServerResponse.writeBody
Writes the entire response body as a single string.
void writeBody
(
string data,
string content_type = null
) @safe;
void writeBody
(
string data,
int status,
string content_type = null
) @safe;
Parameters
Name | Description |
---|---|
data | The string to write as the body contents |
status | Optional response status code to set |
content_type | Optional content type to apply to the response.
If no content type is given and no "Content-Type" header is
set in the response, this will default to
"text/plain; charset=UTF-8" . |
See Also
HTTPStatusCode
ditto