MySQL 8.0.40
Source Code Documentation
http_request.h File Reference
#include "mysqlrouter/http_common_export.h"
#include <bitset>
#include <ctime>
#include <functional>
#include <memory>
#include <stdexcept>
#include <string>
#include <system_error>
#include <vector>
#include "mysql/harness/net_ts/impl/socket_constants.h"

Go to the source code of this file.

Classes

class  EventHttpBoundSocket
 Http bound socket. More...
 
class  HttpHeaders
 headers of a HTTP response/request. More...
 
class  HttpHeaders::Iterator
 
class  HttpBuffer
 a Buffer to send/read from network. More...
 
class  HttpUri
 representation of HTTP URI. More...
 
class  HttpRequest
 a HTTP request and response. More...
 
class  EventHttp
 Http server build on top of EventBase. More...
 

Namespaces

namespace  HttpStatusCode
 
namespace  HttpMethod
 
namespace  HttpMethod::Pos
 

Typedefs

using HttpStatusCode::name_type = const char *
 
using HttpStatusCode::key_type = int
 
using HttpMethod::type = int
 
using HttpMethod::pos_type = unsigned
 
using HttpMethod::Bitset = std::bitset< Pos::_LAST+1 >
 

Functions

name_type HttpStatusCode::get_default_status_text (key_type key)
 
HTTP_COMMON_EXPORT std::string http_uri_path_canonicalize (const std::string &uri_path)
 canonicalize a URI path. More...
 
HTTP_COMMON_EXPORT time_t time_from_rfc5322_fixdate (const char *date_buf)
 convert a Date: header into a time_t. More...
 
HTTP_COMMON_EXPORT int time_to_rfc5322_fixdate (time_t ts, char *date_buf, size_t date_buf_len)
 convert time_t into a Date: header value. More...
 

Variables

constexpr key_type HttpStatusCode::Continue = 100
 
constexpr key_type HttpStatusCode::SwitchingProtocols = 101
 
constexpr key_type HttpStatusCode::Processing = 102
 
constexpr key_type HttpStatusCode::EarlyHints = 103
 
constexpr key_type HttpStatusCode::Ok = 200
 
constexpr key_type HttpStatusCode::Created = 201
 
constexpr key_type HttpStatusCode::Accepted = 202
 
constexpr key_type HttpStatusCode::NonAuthoritiveInformation = 203
 
constexpr key_type HttpStatusCode::NoContent = 204
 
constexpr key_type HttpStatusCode::ResetContent = 205
 
constexpr key_type HttpStatusCode::PartialContent = 206
 
constexpr key_type HttpStatusCode::MultiStatus = 207
 
constexpr key_type HttpStatusCode::AlreadyReported = 208
 
constexpr key_type HttpStatusCode::InstanceManipulationUsed = 226
 
constexpr key_type HttpStatusCode::MultipleChoices = 300
 
constexpr key_type HttpStatusCode::MovedPermanently = 301
 
constexpr key_type HttpStatusCode::Found = 302
 
constexpr key_type HttpStatusCode::SeeOther = 303
 
constexpr key_type HttpStatusCode::NotModified = 304
 
constexpr key_type HttpStatusCode::UseProxy = 305
 
constexpr key_type HttpStatusCode::TemporaryRedirect = 307
 
constexpr key_type HttpStatusCode::PermanentRedirect = 308
 
constexpr key_type HttpStatusCode::BadRequest = 400
 
constexpr key_type HttpStatusCode::Unauthorized = 401
 
constexpr key_type HttpStatusCode::PaymentRequired = 402
 
constexpr key_type HttpStatusCode::Forbidden = 403
 
constexpr key_type HttpStatusCode::NotFound = 404
 
constexpr key_type HttpStatusCode::MethodNotAllowed = 405
 
constexpr key_type HttpStatusCode::NotAcceptable = 406
 
constexpr key_type HttpStatusCode::ProxyAuthenticationRequired = 407
 
constexpr key_type HttpStatusCode::RequestTimeout = 408
 
constexpr key_type HttpStatusCode::Conflicts = 409
 
constexpr key_type HttpStatusCode::Gone = 410
 
constexpr key_type HttpStatusCode::LengthRequired = 411
 
constexpr key_type HttpStatusCode::PreconditionFailed = 412
 
constexpr key_type HttpStatusCode::PayloadTooLarge = 413
 
constexpr key_type HttpStatusCode::URITooLarge = 414
 
constexpr key_type HttpStatusCode::UnsupportedMediaType = 415
 
constexpr key_type HttpStatusCode::RangeNotSatisfiable = 416
 
constexpr key_type HttpStatusCode::ExpectationFailed = 417
 
constexpr key_type HttpStatusCode::IamaTeapot = 418
 
constexpr key_type HttpStatusCode::MisdirectedRequest = 421
 
constexpr key_type HttpStatusCode::UnprocessableEntity = 422
 
constexpr key_type HttpStatusCode::Locked = 423
 
constexpr key_type HttpStatusCode::FailedDependency = 424
 
constexpr key_type HttpStatusCode::UpgradeRequired = 426
 
constexpr key_type HttpStatusCode::PreconditionRequired = 428
 
constexpr key_type HttpStatusCode::TooManyRequests = 429
 
constexpr key_type HttpStatusCode::RequestHeaderFieldsTooLarge = 431
 
constexpr key_type HttpStatusCode::UnavailableForLegalReasons = 451
 
constexpr key_type HttpStatusCode::InternalError = 500
 
constexpr key_type HttpStatusCode::NotImplemented = 501
 
constexpr key_type HttpStatusCode::BadGateway = 502
 
constexpr key_type HttpStatusCode::ServiceUnavailable = 503
 
constexpr key_type HttpStatusCode::GatewayTimeout = 504
 
constexpr key_type HttpStatusCode::HTTPVersionNotSupported = 505
 
constexpr key_type HttpStatusCode::VariantAlsoNegotiates = 506
 
constexpr key_type HttpStatusCode::InsufficientStorage = 507
 
constexpr key_type HttpStatusCode::LoopDetected = 508
 
constexpr key_type HttpStatusCode::NotExtended = 510
 
constexpr key_type HttpStatusCode::NetworkAuthorizationRequired = 511
 
constexpr pos_type HttpMethod::Pos::Get = 0
 
constexpr pos_type HttpMethod::Pos::Post = 1
 
constexpr pos_type HttpMethod::Pos::Head = 2
 
constexpr pos_type HttpMethod::Pos::Put = 3
 
constexpr pos_type HttpMethod::Pos::Delete = 4
 
constexpr pos_type HttpMethod::Pos::Options = 5
 
constexpr pos_type HttpMethod::Pos::Trace = 6
 
constexpr pos_type HttpMethod::Pos::Connect = 7
 
constexpr pos_type HttpMethod::Pos::Patch = 8
 
constexpr pos_type HttpMethod::Pos::_LAST = Patch
 
constexpr type HttpMethod::Get {1 << Pos::Get}
 
constexpr type HttpMethod::Post {1 << Pos::Post}
 
constexpr type HttpMethod::Head {1 << Pos::Head}
 
constexpr type HttpMethod::Put {1 << Pos::Put}
 
constexpr type HttpMethod::Delete {1 << Pos::Delete}
 
constexpr type HttpMethod::Options {1 << Pos::Options}
 
constexpr type HttpMethod::Trace {1 << Pos::Trace}
 
constexpr type HttpMethod::Connect {1 << Pos::Connect}
 
constexpr type HttpMethod::Patch {1 << Pos::Patch}
 

Function Documentation

◆ http_uri_path_canonicalize()

HTTP_COMMON_EXPORT std::string http_uri_path_canonicalize ( const std::string &  uri_path)

canonicalize a URI path.

input output
/ /
/./ /
// /
/../ /
/a/../ /
/../a/ /a/
/../a /a

◆ time_from_rfc5322_fixdate()

HTTP_COMMON_EXPORT time_t time_from_rfc5322_fixdate ( const char *  date_buf)

convert a Date: header into a time_t.

Returns
a time_t representation of Date: header value
Exceptions
std::out_of_rangeon invalid formats

◆ time_to_rfc5322_fixdate()

HTTP_COMMON_EXPORT int time_to_rfc5322_fixdate ( time_t  ts,
char *  date_buf,
size_t  date_buf_len 
)

convert time_t into a Date: header value.