SNode.C
Loading...
Searching...
No Matches
clients.h File Reference
#include "web/http/STREAM/NET/Client.h"
#include "web/http/STREAM/NET/EventSource.h"
Include dependency graph for clients.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  apps
namespace  apps::http
namespace  apps::http::legacy
namespace  apps::http::tls

Macros

#define QUOTE_INCLUDE(a)
#define STR_INCLUDE(a)
#define CLIENT_INCLUDE   QUOTE_INCLUDE(web/http/STREAM/NET/Client.h)
#define EVENTSOURCE_INCLUDE   QUOTE_INCLUDE(web/http/STREAM/NET/EventSource.h)
#define LONG

Typedefs

using apps::http::legacy::Client = web::http::legacy::NET::Client
using apps::http::legacy::MasterRequest = Client::MasterRequest
using apps::http::legacy::Request = Client::Request
using apps::http::legacy::Response = Client::Response
using apps::http::legacy::SocketConnection = Client::SocketConnection
using apps::http::tls::Client = web::http::tls::NET::Client
using apps::http::tls::MasterRequest = Client::MasterRequest
using apps::http::tls::Request = Client::Request
using apps::http::tls::Response = Client::Response
using apps::http::tls::SocketConnection = Client::SocketConnection

Functions

static void logResponse (const std::shared_ptr< web::http::client::Request > &req, const std::shared_ptr< web::http::client::Response > &res)
Client apps::http::legacy::getClient ()
Client apps::http::tls::getClient ()

Macro Definition Documentation

◆ CLIENT_INCLUDE

#define CLIENT_INCLUDE   QUOTE_INCLUDE(web/http/STREAM/NET/Client.h)

Definition at line 49 of file clients.h.

◆ EVENTSOURCE_INCLUDE

#define EVENTSOURCE_INCLUDE   QUOTE_INCLUDE(web/http/STREAM/NET/EventSource.h)

Definition at line 51 of file clients.h.

◆ LONG

#define LONG

◆ QUOTE_INCLUDE

#define QUOTE_INCLUDE ( a)
Value:
#define STR_INCLUDE(a)
Definition servers.h:48

Definition at line 45 of file clients.h.

◆ STR_INCLUDE

#define STR_INCLUDE ( a)
Value:
#a

Definition at line 46 of file clients.h.

Function Documentation

◆ logResponse()

void logResponse ( const std::shared_ptr< web::http::client::Request > & req,
const std::shared_ptr< web::http::client::Response > & res )
static

Definition at line 71 of file clients.h.

71 {
72 VLOG(1) << req->getSocketContext()->getSocketConnection()->getConnectionName() << " HTTP response: " << req->method << " " << req->url
73 << " HTTP/" << req->httpMajor << "." << req->httpMinor << "\n"
74 << httputils::toString(req->method,
75 req->url,
76 "HTTP/" + std::to_string(req->httpMajor) + "." + std::to_string(req->httpMinor),
77 req->getQueries(),
78 req->getHeaders(),
79 req->getTrailer(),
80 req->getCookies(),
81 {})
82 << "\n"
83 << httputils::toString(res->httpVersion, res->statusCode, res->reason, res->headers, res->cookies, res->body);
84}
std::string toString(const std::string &method, const std::string &url, const std::string &version, const web::http::CiStringMap< std::string > &queries, const web::http::CiStringMap< std::string > &header, const web::http::CiStringMap< std::string > &trailer, const web::http::CiStringMap< std::string > &cookies, const std::vector< char > &body)