dot-xx
A personal collection of small C++ modules
Loading...
Searching...
No Matches
message.xx File Reference
module dxx.http

Request and Response types More...

import dxx.http:status_codes;
import std;

Classes

struct  dxx::http::HeaderCompare
 HTTP headers comparison struct - they must be case-insensitive. More...
struct  dxx::http::Request
 HTTP request structure. Also used for multipart request data. More...
struct  dxx::http::Response
 Server's response to the client. More...

Typedefs

using dxx::http::StringMap = std::unordered_map<std::string, std::string>

Enumerations

enum class  dxx::http::HeaderError {
  None , Method , Header , Unterminated ,
  StrayData
}
 An error during HTTP request header parsing. More...
enum class  dxx::http::MultipartError {
  NotMultipart , Unterminated , NoPartBody , UnterminatedHeader ,
  InvalidHeader
}
 An error during parsing of a multipart request. More...

Functions

StringMap dxx::http::parse_content_disposition (std::string_view data)
 Parse Content-Disposition header.

Detailed Description

Request and Response types

Enumeration Type Documentation

◆ HeaderError

enum class dxx::http::HeaderError
exportstrong

An error during HTTP request header parsing.

Enumerator
None 

No error was discovered.

Method 

Incorrect method string.

Header 

Incorrect header.

Unterminated 

Parser reached the end of the content in a state that's not the final expected state.

StrayData 

Stray data in the header.

This is not a fatal error, the result is still usable if this value is returned

◆ MultipartError

enum class dxx::http::MultipartError
exportstrong

An error during parsing of a multipart request.

Enumerator
NotMultipart 

The request is not a multipart request.

Unterminated 

The multipart data was not properly terminated.

NoPartBody 

A single part was read, but the header/body separator is missing.

UnterminatedHeader 

Multipart header unterminated.

InvalidHeader 

Invalid header.