userver: http Namespace Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
http Namespace Reference

Detailed Description

HTTP helpers.

Namespaces

namespace  headers
 Common HTTP headers.
 

Classes

class  ContentType
 Content-Type representation. More...
 
class  ContentTypeHash
 
class  MalformedContentType
 Content-Type parsing error. More...
 

Typedefs

using Args = std::unordered_map<std::string, std::string, utils::StrCaseHash>
 
using MultiArgs = std::multimap<std::string, std::string>
 

Functions

bool operator== (const ContentType &, const ContentType &)
 
bool operator!= (const ContentType &, const ContentType &)
 
bool operator< (const ContentType &, const ContentType &)
 
std::ostream & operator<< (std::ostream &, const ContentType &)
 
std::string UrlDecode (std::string_view range)
 Decode URL.
 
std::string UrlEncode (std::string_view input_string)
 Encode as URL.
 
std::string MakeQuery (const Args &query_args)
 Make an URL query.
 
std::string MakeQuery (const std::unordered_map< std::string, std::string > &query_args)
 Make an URL query.
 
std::string MakeQuery (std::initializer_list< std::pair< std::string_view, std::string_view > > query_args)
 Make an URL query.
 
std::string MakeUrl (std::string_view path, const Args &query_args)
 Make an URL with query arguments.
 
std::string MakeUrl (std::string_view path, const std::unordered_map< std::string, std::string > &query_args)
 Make an URL with query arguments.
 
std::string MakeUrl (std::string_view path, const Args &query_args, MultiArgs query_multiargs)
 Make an URL with query arguments.
 
std::string MakeUrl (std::string_view path, std::initializer_list< std::pair< std::string_view, std::string_view > > query_args)
 Make an URL with query arguments.
 
std::string ExtractMetaTypeFromUrl (const std::string &url)
 Returns URL part before the first '?' character.
 
std::string ExtractPath (std::string_view url)
 Returns HTTP path part of a URL.
 
std::string ExtractHostname (std::string_view url)
 Returns hostname part of a URL.
 

Typedef Documentation

◆ Args

using http::Args = std::unordered_map<std::string, std::string, utils::StrCaseHash>

Definition at line 26 of file url.hpp.

◆ MultiArgs

using http::MultiArgs = std::multimap<std::string, std::string>

Definition at line 27 of file url.hpp.

Function Documentation

◆ operator<()

bool http::operator< ( const ContentType & ,
const ContentType &  )

Weak ordering for Accept media-ranges checking. Positions less specific types before more specific, so that the most specific type can be matched first.