forked from boostorg/beast
Documentation work
This commit is contained in:
1 parent
38c36ac655
commit
cff5be3837
31 files changed
+510
-353
No files matched your search
@@ -7,13 +7,9 @@
|
||||
|
||||
#include <beast.hpp>
|
||||
|
||||
/*
|
||||
This file contains all of the example code snippets contained
|
||||
in the documentation, which directly includes this source code.
|
||||
*/
|
||||
// Contains the HTTP Examples from the documentation.
|
||||
|
||||
// The documentation assumes the beast::http namespace
|
||||
|
||||
namespace beast {
|
||||
namespace http {
|
||||
|
||||
@@ -194,7 +190,7 @@ send_cgi_response(
|
||||
|
||||
// Set up the response. We use the buffer_body type,
|
||||
// allowing serialization to use manually provided buffers.
|
||||
message<false, buffer_body, fields> res;
|
||||
response<buffer_body> res;
|
||||
|
||||
res.result(status::ok);
|
||||
res.version = 11;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <beast.hpp>
|
||||
|
||||
// Contains the WebSocket Examples from the documentation.
|
||||
|
||||
|
||||
// The documentation assumes the beast::websocket namespace
|
||||
|
||||
namespace beast {
|
||||
namespace websocket {
|
||||
|
||||
} // websocket
|
||||
} // beast
|
||||
@@ -29,9 +29,9 @@ int main()
|
||||
req.method(beast::http::verb::get);
|
||||
req.target("/");
|
||||
req.version = 11;
|
||||
req.replace("Host", host + ":" +
|
||||
req.insert(beast::http::field::host, host + ":" +
|
||||
boost::lexical_cast<std::string>(sock.remote_endpoint().port()));
|
||||
req.replace("User-Agent", "Beast");
|
||||
req.insert(beast::http::field::user_agent, "Beast");
|
||||
req.prepare();
|
||||
beast::http::write(sock, req);
|
||||
|
||||
|
||||
Reference in new issue
Block a user