Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

class mount_response

5cript edited this page Apr 25, 2021 · 7 revisions

class mount_response

A mount response is like a response_handler, but has much less functions.

Summary

Members Descriptions
public mount_response & append(std::string const & field,std::string const & value) Appends the specified value to the HTTP response header field.
public mount_response & set(std::string const & field,std::string const & value) Sets the response�s HTTP header field to value.
public mount_response & try_set(std::string const & field,std::string const & value) Sets the response�s HTTP header field to value, if not set.
public mount_response & status(int status) Sets the response code.
public int get_status() const Gets the response code.
public void to_response(response_handler & res) const

Members


public mount_response & append(std::string const & field,std::string const & value)

Appends the specified value to the HTTP response header field.

If the header is not already set, it creates the header with the specified value.

Parameters

  • field A header field identifier, such as "Warning" or "Link"

  • value A value that is to be appended.

Returns: *this for chaining.


public mount_response & set(std::string const & field,std::string const & value)

Sets the response�s HTTP header field to value.

Parameters

  • field A header field identifier, such as "Warning" or "Link"

  • value A value that is to be appended.

Returns: *this for chaining.


public mount_response & try_set(std::string const & field,std::string const & value)

Sets the response�s HTTP header field to value, if not set.

Parameters

  • field A header field identifier, such as "Warning" or "Link"

  • value A value that is to be appended.

Returns: *this for chaining.


public mount_response & status(int status)

Sets the response code.

Parameters

  • code A response code 1xx, 2xx, 3xx, 4xx or 5xx

Returns: *this for chaining.


public int get_status() const

Gets the response code.

Returns: A response code 1xx, 2xx, 3xx, 4xx or 5xx


public void to_response(response_handler & res) const

Clone this wiki locally