|
fastdo
0.6.16
|
HTTP响应 更多...
#include <http_Response.hpp>


Public 成员函数 | |
| Response (Request &req, winux::SimplePointer< RspOutputMgr > outputMgr) | |
| 构造函数 更多... | |
| virtual | ~Response () |
| 析构函数 更多... | |
| void | echo (winux::String const &str) |
| 输出字符串 更多... | |
| void | write (void const *data, int size) |
| 输出二进制数据 更多... | |
| void | write (winux::Buffer const &buf) |
| 输出二进制数据 更多... | |
| void | printf (char const *format,...) |
| 输出格式化字符串 更多... | |
| void | commitHeader () |
| 提交一些自动的响应头到输出管理器 更多... | |
| void | commit () |
| 使输出管理器实际输出响应(包括头部和响应数据) 更多... | |
| winux::String | getLocalEncoding () const |
| 获取本地编码 更多... | |
| winux::String | getTargetEncoding () const |
| 获取目标编码 更多... | |
| winux::String | convFrom (winux::String const &str) const |
| 目标编码转到本地编码 更多... | |
| winux::String | convTo (winux::String const &str) const |
| 本地编码转到目标编码 更多... | |
| void | setCharset (winux::String const &charset) |
| 设置charset,即设置输出目标编码 更多... | |
| winux::String | getCharset () const |
| 获取charset,即输出目标编码 更多... | |
| void | setMimeType (winux::String const &mime) |
| 设置MIME 更多... | |
| winux::String | getMimeType () const |
| 获取MIME 更多... | |
| void | setAutoContentType (bool autoContentType=true) |
是否自动设置Content-Type 更多... | |
| template<typename _Ty > | |
| std::ostream & | operator<< (_Ty const &v) |
使Response能用operator <<输出内容 更多... | |
| RspOutputMgr * | getOutputMgr () const |
| 暴露输出管理器 更多... | |
Public 属性 | |
| Request & | request |
http::Request对象的引用 更多... | |
| http::Header & | header |
| 响应头部的引用 更多... | |
HTTP响应
在文件 http_Response.hpp 第 8 行定义.
| http::Response::Response | ( | Request & | req, |
| winux::SimplePointer< RspOutputMgr > | outputMgr | ||
| ) |
构造函数
| [in] | req | 请求对象 |
| [in] | outputMgr | 输出管理器 |
|
virtual |
析构函数
| void http::Response::echo | ( | winux::String const & | str | ) |
输出字符串
| void http::Response::write | ( | void const * | data, |
| int | size | ||
| ) |
输出二进制数据
| void http::Response::write | ( | winux::Buffer const & | buf | ) |
输出二进制数据
| void http::Response::printf | ( | char const * | format, |
| ... | |||
| ) |
输出格式化字符串
| void http::Response::commitHeader | ( | ) |
提交一些自动的响应头到输出管理器
头部只会提交一次。意味着第一次调用commitHeader()后你对header的任何修改都是无效的。
| void http::Response::commit | ( | ) |
使输出管理器实际输出响应(包括头部和响应数据)
内部也会调用commitHeader(),但是头部只会输出一次。意味着第一次调用commit()后你对header的任何修改都是无效的。
| winux::String http::Response::getLocalEncoding | ( | ) | const |
获取本地编码
| winux::String http::Response::getTargetEncoding | ( | ) | const |
获取目标编码
| winux::String http::Response::convFrom | ( | winux::String const & | str | ) | const |
目标编码转到本地编码
| winux::String http::Response::convTo | ( | winux::String const & | str | ) | const |
本地编码转到目标编码
| void http::Response::setCharset | ( | winux::String const & | charset | ) |
设置charset,即设置输出目标编码
| winux::String http::Response::getCharset | ( | ) | const |
获取charset,即输出目标编码
|
inline |
设置MIME
在文件 http_Response.hpp 第 61 行定义.
|
inline |
获取MIME
在文件 http_Response.hpp 第 64 行定义.
|
inline |
是否自动设置Content-Type
Response在即将完成输出前会配合MIME和目标编码自动设置Content-Type。
如果MIME不是文本,则不会设置charset部分
在文件 http_Response.hpp 第 70 行定义.
|
inline |
使Response能用operator <<输出内容
在文件 http_Response.hpp 第 74 行定义.
|
inline |
暴露输出管理器
在文件 http_Response.hpp 第 80 行定义.
| Request& http::Response::request |
http::Request对象的引用
在文件 http_Response.hpp 第 82 行定义.
| http::Header& http::Response::header |
响应头部的引用
在文件 http_Response.hpp 第 83 行定义.