userver: http::ContentType Class 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::ContentType Class Reference

Content-Type representation. More...

#include <userver/http/content_type.hpp>

Public Member Functions

std::string MediaType () const
 Media type (application/json).
 
const std::string & TypeToken () const
 "type" token of media type (application).
 
const std::string & SubtypeToken () const
 "subtype" token of media type (json).
 
bool HasExplicitCharset () const
 Whether the "charset" option was explicitly specified.
 
const std::string & Charset () const
 Charset (utf-8).
 
int Quality () const
 Value of "q" parameter in range 0–1000.
 
bool DoesAccept (const ContentType &) const
 
std::string ToString () const
 Builds a string representation of content-type/media-range.
 
 ContentType (std::string_view)
 
 ContentType (const std::string &)
 
 ContentType (const char *)
 

Detailed Description

Content-Type representation.

Definition at line 26 of file content_type.hpp.

Constructor & Destructor Documentation

◆ ContentType()

http::ContentType::ContentType ( std::string_view  )

Constructor from a single content-type/media-range header value as per RFC7231.

Member Function Documentation

◆ DoesAccept()

bool http::ContentType::DoesAccept ( const ContentType ) const

Whether this media range accepts specified content type. Differs from equality comparison in wildcard support.


The documentation for this class was generated from the following file: