HTTP v1.13.1
Loading...
Searching...
No Matches
HTTPUtility.h File Reference
#include <ostream>
#include <unordered_map>
#include <string>
#include <optional>

Go to the source code of this file.

Classes

struct  web::InsensitiveStringHash
 Custom hashing for headers with case insensitive. More...
 
struct  web::InsensitiveStringEqual
 Custom equal for headers. More...
 
class  web::Multipart
 Defines each part of multipart/form-data. More...
 

Namespaces

namespace  web
 

Macros

#define HTTP_API
 
#define HTTP_API_FUNCTION
 

Typedefs

using web::HeadersMap = std::unordered_map<std::string, std::string, InsensitiveStringHash, InsensitiveStringEqual>
 Case insensitive unordered_map.
 

Enumerations

enum class  web::ResponseCodes {
  web::Continue = 100 , web::switchingProtocols , web::processing , web::ok = 200 ,
  web::created , web::accepted , web::nonAuthoritativeInformation , web::noContent ,
  web::resetContent , web::partialContent , web::multiStatus , web::alreadyReported ,
  web::IMUsed = 226 , web::multipleChoices = 300 , web::movedPermanently , web::found ,
  web::seeOther , web::notModified , web::useProxy , web::temporaryRedirect = 307 ,
  web::permanentRedirect , web::badRequest = 400 , web::unauthorized , web::paymentRequired ,
  web::forbidden , web::notFound , web::methodNotAllowed , web::notAcceptable ,
  web::proxyAuthenticationRequired , web::requestTimeout , web::conflict , web::gone ,
  web::lengthRequired , web::preconditionFailed , web::payloadTooLarge , web::URITooLong ,
  web::unsupportedMediaType , web::rangeNotSatisfiable , web::expectationFailed , web::iamATeapot ,
  web::authenticationTimeout , web::misdirectedRequest = 421 , web::unprocessableEntity , web::locked ,
  web::failedDependency , web::upgradeRequired = 426 , web::preconditionRequired = 428 , web::tooManyRequests ,
  web::requestHeaderFieldsTooLarge = 431 , web::retryWith = 449 , web::unavailableForLegalReasons = 451 , web::clientClosedRequest = 499 ,
  web::internalServerError = 500 , web::notImplemented , web::badGateway , web::serviceUnavailable ,
  web::gatewayTimeout , web::HTTPVersionNotSupported , web::variantAlsoNegotiates , web::insufficientStorage ,
  web::loopDetected , web::bandwidthLimitExceeded , web::notExtended , web::networkAuthenticationRequired ,
  web::unknownError = 520 , web::webServerIsDown , web::connectionTimedOut , web::originIsUnreachable ,
  web::aTimeoutOccurred , web::SSLHandshakeFailed , web::invalidSSLCertificate
}
 Response codes. More...
 

Functions

std::ostream & web::operator<< (std::ostream &stream, ResponseCodes responseCode)
 Output stream operator for ResponseCodes.
 
bool web::operator== (int code, ResponseCodes otherCode)
 Compare operator for ResponseCodes.
 
string web::getHTTPLibraryVersion ()
 Get version of HTTP library.
 
HTTP_API_FUNCTION std::string web::encodeUrl (std::string_view data)
 Encode data to application/x-www-form-urlencoded format.
 
HTTP_API_FUNCTION std::string web::decodeUrl (std::string_view data)
 Decode data from application/x-www-form-urlencoded format.
 
template<typename T >
requires (std::same_as<T, ResponseCodes> || std::convertible_to<T, int>)
std::string web::getMessageFromCode (const T &code)
 Get response message from response code.
 
string web::__getMessageFromCode (int code)
 

Macro Definition Documentation

◆ HTTP_API

#define HTTP_API

Definition at line 17 of file HTTPUtility.h.

◆ HTTP_API_FUNCTION

#define HTTP_API_FUNCTION

Definition at line 18 of file HTTPUtility.h.