PIP 5.6.1
Platform-Independent Primitives
Public Member Functions | Static Public Member Functions | List of all members
PIHTTP::MessageMutable Class Reference

Mutable HTTP message with setters and argument/header modifiers. More...

#include <pihttptypes.h>

Inheritance diagram for PIHTTP::MessageMutable:
Inheritance graph
[legend]

Public Member Functions

MessageMutablesetMethod (PIHTTP::Method m)
 Sets the HTTP method.
 
MessageMutablesetCode (PIHTTP::Code c)
 Sets the HTTP status code.
 
MessageMutablesetPath (PIString p)
 Sets the request path or response target path.
 
MessageMutablesetBody (PIByteArray b)
 Sets the message body.
 
const PIMap< PIString, PIString > & headers () const
 Returns all message headers.
 
PIMap< PIString, PIString > & arguments ()
 Returns a modifiable map of all arguments.
 
const PIMap< PIString, PIString > & arguments () const
 Returns all arguments.
 
const PIMap< PIString, PIString > & queryArguments () const
 Returns query arguments.
 
const PIMap< PIString, PIString > & pathArguments () const
 Returns path arguments.
 
PIMap< PIString, PIString > & headers ()
 Returns a modifiable map of all message headers.
 
MessageMutableaddHeader (const PIString &header, const PIString &value)
 Adds or replaces a header in the message.
 
MessageMutableremoveHeader (const PIString &header)
 Removes a header from the message.
 
PIMap< PIString, PIString > & queryArguments ()
 Returns a modifiable map of query arguments.
 
MessageMutableaddQueryArgument (const PIString &arg, const PIString &value)
 Adds or replaces a query argument.
 
MessageMutableremoveQueryArgument (const PIString &arg)
 Removes a query argument.
 
PIMap< PIString, PIString > & pathArguments ()
 Returns a modifiable map of path arguments.
 
MessageMutableaddPathArgument (const PIString &arg, const PIString &value)
 Adds or replaces a path argument.
 
MessageMutableremovePathArgument (const PIString &arg)
 Removes a path argument.
 
- Public Member Functions inherited from PIHTTP::MessageConst
PIHTTP::Method method () const
 Returns the HTTP method of the message.
 
PIHTTP::Code code () const
 Returns the HTTP status code of the message.
 
bool isCodeInformational () const
 Returns true for informational status codes in the 1xx range.
 
bool isCodeSuccess () const
 Returns true for successful status codes in the 2xx range.
 
bool isCodeRedirection () const
 Returns true for redirection status codes in the 3xx range.
 
bool isCodeClientError () const
 Returns true for client error status codes in the 4xx range.
 
bool isCodeServerError () const
 Returns true for server error status codes in the 5xx range.
 
bool isCodeError () const
 Returns true for any client or server error status code.
 
const PIStringpath () const
 Returns the request path or response target path.
 
PIStringList pathList () const
 Returns the path split into non-empty components.
 
const PIByteArraybody () const
 Returns the message body.
 
const PIMap< PIString, PIString > & headers () const
 Returns all message headers.
 
const PIMap< PIString, PIString > & queryArguments () const
 Returns parsed query arguments from the URL.
 
const PIMap< PIString, PIString > & pathArguments () const
 Returns extracted path arguments.
 
const PIMap< PIString, PIString > & arguments () const
 Returns the combined argument map from query and path arguments.
 

Static Public Member Functions

static MessageMutable fromCode (PIHTTP::Code c)
 Creates a message initialized from an HTTP status code.
 
static MessageMutable fromMethod (PIHTTP::Method m)
 Creates a message initialized from an HTTP method.
 

Detailed Description

Mutable HTTP message with setters and argument/header modifiers.