mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 12:57:31 +02:00
Fix warnings in json_client example
This commit is contained in:
committed by
Mohammad Nejati
parent
3ddcf4ed38
commit
7ce0ebe47c
@ -32,8 +32,9 @@ struct json_body
|
|||||||
{
|
{
|
||||||
using const_buffers_type = boost::asio::const_buffer;
|
using const_buffers_type = boost::asio::const_buffer;
|
||||||
template<bool isRequest, class Fields>
|
template<bool isRequest, class Fields>
|
||||||
writer(boost::beast::http::header<isRequest, Fields> const& h,
|
writer(
|
||||||
value_type const& body)
|
boost::beast::http::header<isRequest, Fields> const&,
|
||||||
|
value_type const& body)
|
||||||
{
|
{
|
||||||
// The serializer holds a pointer to the value, so all we need to do is to reset it.
|
// The serializer holds a pointer to the value, so all we need to do is to reset it.
|
||||||
serializer.reset(&body);
|
serializer.reset(&body);
|
||||||
@ -65,7 +66,9 @@ struct json_body
|
|||||||
struct reader
|
struct reader
|
||||||
{
|
{
|
||||||
template<bool isRequest, class Fields>
|
template<bool isRequest, class Fields>
|
||||||
reader(boost::beast::http::header<isRequest, Fields>& h, value_type& body)
|
reader(
|
||||||
|
boost::beast::http::header<isRequest, Fields>&,
|
||||||
|
value_type& body)
|
||||||
: body(body)
|
: body(body)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace http = beast::http; // from <boost/beast/http.hpp>
|
|||||||
namespace net = boost::asio; // from <boost/asio.hpp>
|
namespace net = boost::asio; // from <boost/asio.hpp>
|
||||||
using tcp = net::ip::tcp; // from <boost/asio/ip/tcp.hpp>
|
using tcp = net::ip::tcp; // from <boost/asio/ip/tcp.hpp>
|
||||||
|
|
||||||
int main(int argc, char ** argv)
|
int main(int, char **)
|
||||||
{
|
{
|
||||||
// Our test endpoint for testing the json
|
// Our test endpoint for testing the json
|
||||||
const auto host = "postman-echo.com";
|
const auto host = "postman-echo.com";
|
||||||
|
Reference in New Issue
Block a user