sptk2 logo
SPTK Home Page
Public Member Functions | List of all members
sptk::HttpParams Class Reference

#include <HttpParams.h>

Inheritance diagram for sptk::HttpParams:

Public Member Functions

 HttpParams ()=default
 
 HttpParams (const HttpParams &other)=default
 
 HttpParams (std::initializer_list< std::pair< String, String > > lst)
 
void encode (Buffer &result) const
 
void decode (const Buffer &paramString, bool lowerCaseNames=false)
 
String get (const String &paramName) const
 
bool has (const String &paramName) const
 

Detailed Description

HTTP params map

Designed to hold HTTP parametrs in CHttpConnect and CCgiApplication. It is, basically, a string-to-string map with an addition of encode and decode functions for HTTP Mime.

Constructor & Destructor Documentation

◆ HttpParams() [1/3]

sptk::HttpParams::HttpParams ( )
default

Default constructor.

◆ HttpParams() [2/3]

sptk::HttpParams::HttpParams ( const HttpParams other)
default

Copy constructor.

◆ HttpParams() [3/3]

sptk::HttpParams::HttpParams ( std::initializer_list< std::pair< String, String > >  lst)

Initialization constructor.

Member Function Documentation

◆ decode()

void sptk::HttpParams::decode ( const Buffer paramString,
bool  lowerCaseNames = false 
)

Decodes HTTP parameters that came from the server as a string into parameters map.

Parameters
paramStringParameters string from HTTP server
lowerCaseNamesTrue if you want to lower-case the parameter names

◆ encode()

void sptk::HttpParams::encode ( Buffer result) const

Encodes HTTP parameters for sending to the server.

Parameters
resultOutput - encoded parameters string (if any) as the buffer.

◆ get()

String sptk::HttpParams::get ( const String paramName) const

Returns parameter value, or empty string if not found

Parameters
paramNameParameter name
Returns
parameter value

◆ has()

bool sptk::HttpParams::has ( const String paramName) const

Returns true if parameter exists

Parameters
paramNameParameter name
Returns
true if parameter exists

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

Fri Oct 14 2022 09:58:42: SPTK 5.4.1