Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions | Variables
toolbox::http Namespace Reference

Classes

class  App
 
class  BasicConn
 
class  BasicParser
 
class  BasicServ
 
class  BasicUrl
 
struct  Exception
 
class  OStream
 
class  Request
 
class  StreamBuf
 
class  Url
 
class  UrlView
 

Typedefs

using Conn = BasicConn< Request, App >
 
using Headers = std::vector< std::pair< std::string, std::string > >
 
using Serv = BasicServ< Conn, App >
 

Enumerations

enum class  First : bool { No = false , Yes = true }
 
enum class  NoCache : bool { No = false , Yes = true }
 
enum class  Method : int {
  Delete = HTTP_DELETE , Get = HTTP_GET , Head = HTTP_HEAD , Post = HTTP_POST ,
  Put = HTTP_PUT , Connect = HTTP_CONNECT , Options = HTTP_OPTIONS , Trace = HTTP_TRACE ,
  Copy = HTTP_COPY , Lock = HTTP_LOCK , MkCol = HTTP_MKCOL , Move = HTTP_MOVE ,
  PropFind = HTTP_PROPFIND , PropPatch = HTTP_PROPPATCH , Search = HTTP_SEARCH , Unlock = HTTP_UNLOCK ,
  Bind = HTTP_BIND , Rebind = HTTP_REBIND , Unbind = HTTP_UNBIND , Acl = HTTP_ACL ,
  Report = HTTP_REPORT , MkActivity = HTTP_MKACTIVITY , Checkout = HTTP_CHECKOUT , Merge = HTTP_MERGE ,
  MSearch = HTTP_MSEARCH , Notify = HTTP_NOTIFY , Subscribe = HTTP_SUBSCRIBE , Unsubscribe = HTTP_UNSUBSCRIBE ,
  Patch = HTTP_PATCH , Purge = HTTP_PURGE , MkCalendar = HTTP_MKCALENDAR , Link = HTTP_LINK ,
  Unlink = HTTP_UNLINK , Source = HTTP_SOURCE
}
 
enum class  Status : int {
  Ok = HTTP_STATUS_OK , NoContent = HTTP_STATUS_NO_CONTENT , BadRequest = HTTP_STATUS_BAD_REQUEST , Unauthorized = HTTP_STATUS_UNAUTHORIZED ,
  Forbidden = HTTP_STATUS_FORBIDDEN , NotFound = HTTP_STATUS_NOT_FOUND , MethodNotAllowed = HTTP_STATUS_METHOD_NOT_ALLOWED , RequestTimeout = HTTP_STATUS_REQUEST_TIMEOUT ,
  InternalServerError = HTTP_STATUS_INTERNAL_SERVER_ERROR , ServiceUnavailable = HTTP_STATUS_SERVICE_UNAVAILABLE
}
 
enum class  Type : int { Request = HTTP_REQUEST , Response = HTTP_RESPONSE }
 

Functions

const std::error_category & error_category () noexcept
 
std::error_code make_error_code (Status status)
 
Status http_status (const std::error_code &ec)
 
const charenum_string (Status status) noexcept
 
const charenum_string (Method method) noexcept
 
std::ostream & operator<< (std::ostream &os, Method method)
 
std::ostream & operator<< (std::ostream &os, Status status)
 

Variables

constexpr char ApplicationJson [] {"application/json"}
 
constexpr char TextHtml [] {"text/html"}
 
constexpr char TextPlain [] {"text/plain"}
 

Typedef Documentation

◆ Conn

Definition at line 277 of file Conn.hpp.

◆ Headers

using toolbox::http::Headers = typedef std::vector<std::pair<std::string, std::string> >

Definition at line 27 of file Request.hpp.

◆ Serv

Definition at line 75 of file Serv.hpp.

Enumeration Type Documentation

◆ First

Enumerator
No 
Yes 

Definition at line 27 of file Types.hpp.

◆ NoCache

Enumerator
No 
Yes 

Definition at line 29 of file Types.hpp.

◆ Method

Enumerator
Delete 
Get 
Head 
Post 
Put 
Connect 
Options 
Trace 
Copy 
Lock 
MkCol 
Move 
PropFind 
PropPatch 
Search 
Unlock 
Bind 
Rebind 
Unbind 
Acl 
Report 
MkActivity 
Checkout 
Merge 
MSearch 
Notify 
Subscribe 
Unsubscribe 
Patch 
Purge 
MkCalendar 
Link 
Unlink 
Source 

Definition at line 31 of file Types.hpp.

◆ Status

Enumerator
Ok 
NoContent 
BadRequest 
Unauthorized 
Forbidden 
NotFound 
MethodNotAllowed 
RequestTimeout 
InternalServerError 
ServiceUnavailable 

Definition at line 78 of file Types.hpp.

◆ Type

Enumerator
Request 
Response 

Definition at line 98 of file Types.hpp.

Function Documentation

◆ error_category()

TOOLBOX_API const std::error_category & toolbox::http::error_category ( )
noexcept

Definition at line 42 of file Error.cpp.

◆ make_error_code()

TOOLBOX_API std::error_code toolbox::http::make_error_code ( Status  status)

Definition at line 47 of file Error.cpp.

◆ http_status()

TOOLBOX_API Status toolbox::http::http_status ( const std::error_code &  ec)

Definition at line 52 of file Error.cpp.

◆ enum_string() [1/2]

TOOLBOX_API const char * toolbox::http::enum_string ( Status  status)
noexcept

Definition at line 22 of file Types.cpp.

Referenced by toolbox::http::OStream::reset().

◆ enum_string() [2/2]

const char * toolbox::http::enum_string ( Method  method)
inlinenoexcept

Definition at line 68 of file Types.hpp.

◆ operator<<() [1/2]

std::ostream & toolbox::http::operator<< ( std::ostream &  os,
Method  method 
)
inline

Definition at line 73 of file Types.hpp.

◆ operator<<() [2/2]

std::ostream & toolbox::http::operator<< ( std::ostream &  os,
Status  status 
)
inline

Definition at line 93 of file Types.hpp.

Variable Documentation

◆ ApplicationJson

constexpr char toolbox::http::ApplicationJson[] {"application/json"}
constexpr

Definition at line 27 of file Stream.hpp.

◆ TextHtml

constexpr char toolbox::http::TextHtml[] {"text/html"}
constexpr

Definition at line 28 of file Stream.hpp.

◆ TextPlain

constexpr char toolbox::http::TextPlain[] {"text/plain"}
constexpr

Definition at line 29 of file Stream.hpp.