vibe.d beta banner
get vibe.d
0.8.2

Asynchronous I/O that doesn’t get in your way, written in D

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

NameDescription
data The data to write as the body contents
status Optional response status code to set
content_tyoe 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

NameDescription
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

Authors

Sönke Ludwig, Jan Krüger, Ilya Shipunov

Copyright

© 2012-2017 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.