|
#include <HttpParams.h>
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 ¶mString, bool lowerCaseNames=false) |
| String | get (const String ¶mName) const |
| bool | has (const String ¶mName) const |
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.
|
default |
Default constructor.
|
default |
Copy constructor.
Initialization constructor.
| void sptk::HttpParams::decode | ( | const Buffer & | paramString, |
| bool | lowerCaseNames = false |
||
| ) |
Decodes HTTP parameters that came from the server as a string into parameters map.
| paramString | Parameters string from HTTP server |
| lowerCaseNames | True if you want to lower-case the parameter names |
| void sptk::HttpParams::encode | ( | Buffer & | result | ) | const |
Encodes HTTP parameters for sending to the server.
| result | Output - encoded parameters string (if any) as the buffer. |
Returns parameter value, or empty string if not found
| paramName | Parameter name |
| bool sptk::HttpParams::has | ( | const String & | paramName | ) | const |
Returns true if parameter exists
| paramName | Parameter name |