Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
Use of the flexible __Body__ concept customization point enables authors to preserve the self-contained nature of the __message__ object while allowing domain specific behaviors. Common operations for HTTP servers include sending responses which deliver file contents, and allowing for file uploads. In this example we build the [link beast.ref.boost__beast__http__basic_file_body `basic_file_body`] type which supports both reading and writing to a file on the file system. The interface is a class templated on the type of file used to access the file system, which must meet the requirements of利用灵活的 __Body__ 概念定制点,开发者可以在保持 __message__ 对象自包含特性的同时,赋予其特定领域的行为。HTTP 服务器常见的操作包括发送包含文件内容的响应,以及支持文件上传。本示例构建了 [link beast.ref.boost__beast__http__basic_file_body `basic_file_body`] 类型,支持对文件系统中的文件进行读写操作。该接口是一个类模板,其模板参数为用于访问文件系统的文件类型,该类型必须满足 __File__.的要求。