|
identt
|
Response class where the content of the response is sent to client when the object is about to be destroyed. More...
#include <HttpServerBase.hpp>
Public Member Functions | |
| std::size_t | size () noexcept |
| void | send (const std::function< void(const error_code &)> &callback=nullptr) noexcept |
| Send the content of the response stream to client. More... | |
| void | write (const char_type *ptr, std::streamsize n) |
| Write directly to stream buffer using std::ostream::write. | |
| void | write (StatusCode status_code=StatusCode::success_ok, const CaseInsensitiveMultimap &header=CaseInsensitiveMultimap()) |
| Convenience function for writing status line, potential header fields, and empty content. | |
| void | write (StatusCode status_code, string_view content, const CaseInsensitiveMultimap &header=CaseInsensitiveMultimap()) |
| Convenience function for writing status line, header fields, and content. | |
| void | write (StatusCode status_code, std::istream &content, const CaseInsensitiveMultimap &header=CaseInsensitiveMultimap()) |
| Convenience function for writing status line, header fields, and content. | |
| void | write (string_view content, const CaseInsensitiveMultimap &header=CaseInsensitiveMultimap()) |
| Convenience function for writing success status line, header fields, and content. | |
| void | write (std::istream &content, const CaseInsensitiveMultimap &header=CaseInsensitiveMultimap()) |
| Convenience function for writing success status line, header fields, and content. | |
| void | write (const CaseInsensitiveMultimap &header) |
| Convenience function for writing success status line, and header fields. | |
Public Attributes | |
| bool | close_connection_after_response = false |
| If set to true, force server to close the connection after the response have been sent. More... | |
Friends | |
| class | HttpServerBase< socket_type > |
| class | HttpServer< socket_type > |
Response class where the content of the response is sent to client when the object is about to be destroyed.
|
inlinenoexcept |
Send the content of the response stream to client.
The callback is called when the send has completed.
Use this function if you need to recursively send parts of a longer message, or when using server-sent events.
| bool identt::http::HttpServerBase< socket_type >::Response::close_connection_after_response = false |
If set to true, force server to close the connection after the response have been sent.
This is useful when implementing a HTTP/1.0-server sending content without specifying the content length.
1.8.12