HTTPServerResponse.writeBody - multiple declarations
Function HTTPServerResponse.writeBody
Writes the entire response body at once.
void writeBody
(
in const(ubyte[]) data,
string content_type = null
) scope scope @safe;
void writeBody
(
in const(ubyte[]) data,
int status,
string content_type = null
) scope scope @safe;
void writeBody
(
scope InputStream data,
string content_type = null
) scope scope @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
) scope scope @safe;
void writeBody
(
string data,
int status,
string content_type = null
) scope scope @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