HTTPS/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 48
Connection: Close
{
"DATA": {
"ERROR": "ANY USER IS LOGIN"
}
}
do {
char buf[1024] = "\0";
size_t bytes_transferred = sock.read_some(boost::asio::buffer(buf), ec);
if (!ec) response.append(buf, buf + bytes_transferred);
} while (!ec);
#include <iostream>
#include <algorithm>
#include <iterator>
using namespace std;
int main()
{
char buf[1500]{"HTTPS/1.1 200 OK\nContent-Type: \
application/json; charset=utf-8\n\
Content-Length: 48\
Connection: Close{\"DATA\": {\"ERROR\":\
\"ANY USER IS LOGIN\"}}"};
auto bs{ find(begin(buf) , end(buf) , '{' ) };
auto es{ find(rbegin(buf), rend(buf) , '}' ) };
copy(bs, es.base(), ostream_iterator<char>(cout));
}
{"DATA": {"ERROR": "ANY USER IS LOGIN"}}