userver: http::ContentType Class Reference
Loading...
Searching...
No Matches
http::ContentType Class Reference

#include <userver/http/content_type.hpp>

Detailed Description

Content-Type representation.

Examples
samples/multipart_service/service.cpp.

Definition at line 26 of file 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 *)
 

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: