SNode.C
Loading...
Searching...
No Matches
clients.h File Reference
#include "web/http/STREAM/NET/Client.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)   STR_INCLUDE(a)
 
#define STR_INCLUDE(a)   #a
 
#define CLIENT_INCLUDE   QUOTE_INCLUDE(web/http/STREAM/NET/Client.h)
 
#define LONG
 

Typedefs

using apps::http::legacy::Client = web::http::legacy::NET::Client
 
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::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)
 
static Client apps::http::legacy::getClient ()
 
static Client apps::http::tls::getClient ()
 

Macro Definition Documentation

◆ CLIENT_INCLUDE

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

Definition at line 27 of file clients.h.

◆ LONG

#define LONG

◆ QUOTE_INCLUDE

#define QUOTE_INCLUDE ( a)    STR_INCLUDE(a)

Definition at line 23 of file clients.h.

◆ STR_INCLUDE

#define STR_INCLUDE ( a)    #a

Definition at line 24 of file clients.h.

Function Documentation

◆ logResponse()

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

Definition at line 45 of file clients.h.

45 {
46 VLOG(1) << req->getSocketContext()->getSocketConnection()->getConnectionName() << " HTTP response: " << req->method << " " << req->url
47 << " HTTP/" << req->httpMajor << "." << req->httpMinor << "\n"
49 req->url,
50 "HTTP/" + std::to_string(req->httpMajor) + "." + std::to_string(req->httpMinor),
51 req->getQueries(),
52 req->getHeaders(),
53 req->getCookies(),
54 {})
55 << "\n"
56 << httputils::toString(res->httpVersion, res->statusCode, res->reason, res->headers, res->cookies, res->body);
57}
const std::string & getConnectionName() const
SocketConnection * getSocketConnection() const
const CiStringMap< std::string > & getQueries() const
Definition Request.cpp:620
const CiStringMap< std::string > & getCookies() const
Definition Request.cpp:628
web::http::client::SocketContext * getSocketContext() const
Definition Request.cpp:632
const CiStringMap< std::string > & getHeaders() const
Definition Request.cpp:624
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 > &cookies, const std::vector< char > &body)