我想向 cppnet-lib basic_response 对象添加标头。但是,我收到编译错误。
我可以将标头添加到 basic_request 中,如下所示可以编译:
boost::network::http::basic_request<boost::network::http::tags::http_server> request;
request << header("test", "test");
但是,如下对响应对象执行相同操作会收到编译错误:
boost::network::http::basic_response<boost::network::http::tags::http_server> response;
response << header("test", "test");
编译错误:
'headers_container_type': the symbol to the left of a '::' must be a type (header.hpp)
'value_type': is not a member of boost::network::http::basic_response<boost::network::http::tags::http_server> (header.hpp)
syntax error: missing ';' before identifier 'value_type' (header.hpp)
这表明这在响应对象上是不可能的,但遵循以下页面似乎表明它是。我显然在某个地方出错了!
文档:http ://cpp-netlib.org/0.8/reference_http_response.html
我的环境是:
- Visual Studio 2013(作为发行版构建)
- 提升 1.55
- cppnet 库:0.11.0
任何帮助将不胜感激!谢谢。