PionNetworkLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pion::http::types Struct Reference

#include <types.hpp>

Inheritance diagram for pion::http::types:
Collaboration diagram for pion::http::types:

Public Member Functions

virtual ~types ()
 virtual destructor More...
 

Static Public Member Functions

static std::string get_date_string (const time_t t)
 converts time_t format into an HTTP-date string More...
 
static std::string make_query_string (const ihash_multimap &query_params)
 builds an HTTP query string from a collection of query parameters More...
 
static std::string make_set_cookie_header (const std::string &name, const std::string &value, const std::string &path, const bool has_max_age=false, const unsigned long max_age=0)
 

Static Public Attributes

static const std::string STRING_EMPTY
 
static const std::string STRING_CRLF
 
static const std::string STRING_HTTP_VERSION
 
static const std::string HEADER_NAME_VALUE_DELIMITER
 
static const std::string COOKIE_NAME_VALUE_DELIMITER
 
static const std::string HEADER_HOST
 
static const std::string HEADER_COOKIE
 
static const std::string HEADER_SET_COOKIE
 
static const std::string HEADER_CONNECTION
 
static const std::string HEADER_CONTENT_TYPE
 
static const std::string HEADER_CONTENT_LENGTH
 
static const std::string HEADER_CONTENT_LOCATION
 
static const std::string HEADER_CONTENT_ENCODING
 
static const std::string HEADER_CONTENT_DISPOSITION
 
static const std::string HEADER_LAST_MODIFIED
 
static const std::string HEADER_IF_MODIFIED_SINCE
 
static const std::string HEADER_TRANSFER_ENCODING
 
static const std::string HEADER_LOCATION
 
static const std::string HEADER_AUTHORIZATION
 
static const std::string HEADER_REFERER
 
static const std::string HEADER_USER_AGENT
 
static const std::string HEADER_X_FORWARDED_FOR
 
static const std::string HEADER_CLIENT_IP
 
static const std::string CONTENT_TYPE_HTML
 
static const std::string CONTENT_TYPE_TEXT
 
static const std::string CONTENT_TYPE_XML
 
static const std::string CONTENT_TYPE_URLENCODED
 
static const std::string CONTENT_TYPE_MULTIPART_FORM_DATA
 
static const std::string REQUEST_METHOD_HEAD
 
static const std::string REQUEST_METHOD_GET
 
static const std::string REQUEST_METHOD_PUT
 
static const std::string REQUEST_METHOD_POST
 
static const std::string REQUEST_METHOD_DELETE
 
static const std::string RESPONSE_MESSAGE_OK
 
static const std::string RESPONSE_MESSAGE_CREATED
 
static const std::string RESPONSE_MESSAGE_ACCEPTED
 
static const std::string RESPONSE_MESSAGE_NO_CONTENT
 
static const std::string RESPONSE_MESSAGE_FOUND
 
static const std::string RESPONSE_MESSAGE_UNAUTHORIZED
 
static const std::string RESPONSE_MESSAGE_FORBIDDEN
 
static const std::string RESPONSE_MESSAGE_NOT_FOUND
 
static const std::string RESPONSE_MESSAGE_METHOD_NOT_ALLOWED
 
static const std::string RESPONSE_MESSAGE_NOT_MODIFIED
 
static const std::string RESPONSE_MESSAGE_BAD_REQUEST
 
static const std::string RESPONSE_MESSAGE_SERVER_ERROR
 
static const std::string RESPONSE_MESSAGE_NOT_IMPLEMENTED
 
static const std::string RESPONSE_MESSAGE_CONTINUE
 
static const unsigned int RESPONSE_CODE_OK = 200
 
static const unsigned int RESPONSE_CODE_CREATED = 201
 
static const unsigned int RESPONSE_CODE_ACCEPTED = 202
 
static const unsigned int RESPONSE_CODE_NO_CONTENT = 204
 
static const unsigned int RESPONSE_CODE_FOUND = 302
 
static const unsigned int RESPONSE_CODE_UNAUTHORIZED = 401
 
static const unsigned int RESPONSE_CODE_FORBIDDEN = 403
 
static const unsigned int RESPONSE_CODE_NOT_FOUND = 404
 
static const unsigned int RESPONSE_CODE_METHOD_NOT_ALLOWED = 405
 
static const unsigned int RESPONSE_CODE_NOT_MODIFIED = 304
 
static const unsigned int RESPONSE_CODE_BAD_REQUEST = 400
 
static const unsigned int RESPONSE_CODE_SERVER_ERROR = 500
 
static const unsigned int RESPONSE_CODE_NOT_IMPLEMENTED = 501
 
static const unsigned int RESPONSE_CODE_CONTINUE = 100
 

Detailed Description

types: common data types used by HTTP

Constructor & Destructor Documentation

virtual pion::http::types::~types ( )
inlinevirtual

virtual destructor

Member Function Documentation

std::string pion::http::types::get_date_string ( const time_t  t)
static

converts time_t format into an HTTP-date string

Referenced by pion::http::response::set_last_modified().

std::string pion::http::types::make_query_string ( const ihash_multimap query_params)
static

builds an HTTP query string from a collection of query parameters

References pion::algorithm::url_encode().

Referenced by pion::http::request::use_query_params_for_post_content(), and pion::http::request::use_query_params_for_query_string().

std::string pion::http::types::make_set_cookie_header ( const std::string &  name,
const std::string &  value,
const std::string &  path,
const bool  has_max_age = false,
const unsigned long  max_age = 0 
)
static

creates a "Set-Cookie" header

Parameters
namethe name of the cookie
valuethe value of the cookie
paththe path of the cookie
has_max_agetrue if the max_age value should be set
max_agethe life of the cookie, in seconds (0 = discard)
Returns
the new "Set-Cookie" header

Referenced by pion::http::response::delete_cookie(), and pion::http::response::set_cookie().

Member Data Documentation

const std::string pion::http::types::CONTENT_TYPE_HTML
static
const std::string pion::http::types::CONTENT_TYPE_MULTIPART_FORM_DATA
static
const std::string pion::http::types::CONTENT_TYPE_TEXT
static
const std::string pion::http::types::CONTENT_TYPE_URLENCODED
static
const std::string pion::http::types::CONTENT_TYPE_XML
static
const std::string pion::http::types::COOKIE_NAME_VALUE_DELIMITER
static
const std::string pion::http::types::HEADER_AUTHORIZATION
static
const std::string pion::http::types::HEADER_CLIENT_IP
static
const std::string pion::http::types::HEADER_CONNECTION
static
const std::string pion::http::types::HEADER_CONTENT_DISPOSITION
static
const std::string pion::http::types::HEADER_CONTENT_ENCODING
static
const std::string pion::http::types::HEADER_CONTENT_LENGTH
static
const std::string pion::http::types::HEADER_CONTENT_LOCATION
static
const std::string pion::http::types::HEADER_CONTENT_TYPE
static
const std::string pion::http::types::HEADER_COOKIE
static
const std::string pion::http::types::HEADER_HOST
static
const std::string pion::http::types::HEADER_IF_MODIFIED_SINCE
static
const std::string pion::http::types::HEADER_LAST_MODIFIED
static
const std::string pion::http::types::HEADER_LOCATION
static
const std::string pion::http::types::HEADER_NAME_VALUE_DELIMITER
static
const std::string pion::http::types::HEADER_REFERER
static
const std::string pion::http::types::HEADER_SET_COOKIE
static
const std::string pion::http::types::HEADER_TRANSFER_ENCODING
static
const std::string pion::http::types::HEADER_USER_AGENT
static
const std::string pion::http::types::HEADER_X_FORWARDED_FOR
static
const std::string pion::http::types::REQUEST_METHOD_DELETE
static
const std::string pion::http::types::REQUEST_METHOD_GET
static
const std::string pion::http::types::REQUEST_METHOD_HEAD
static
const std::string pion::http::types::REQUEST_METHOD_POST
static
const std::string pion::http::types::REQUEST_METHOD_PUT
static
const unsigned int pion::http::types::RESPONSE_CODE_ACCEPTED = 202
static
const unsigned int pion::http::types::RESPONSE_CODE_BAD_REQUEST = 400
static
const unsigned int pion::http::types::RESPONSE_CODE_CONTINUE = 100
static
const unsigned int pion::http::types::RESPONSE_CODE_CREATED = 201
static
const unsigned int pion::http::types::RESPONSE_CODE_FORBIDDEN = 403
static
const unsigned int pion::http::types::RESPONSE_CODE_FOUND = 302
static
const unsigned int pion::http::types::RESPONSE_CODE_METHOD_NOT_ALLOWED = 405
static
const unsigned int pion::http::types::RESPONSE_CODE_NO_CONTENT = 204
static
const unsigned int pion::http::types::RESPONSE_CODE_NOT_FOUND = 404
static
const unsigned int pion::http::types::RESPONSE_CODE_NOT_IMPLEMENTED = 501
static
const unsigned int pion::http::types::RESPONSE_CODE_NOT_MODIFIED = 304
static
const unsigned int pion::http::types::RESPONSE_CODE_OK = 200
static
const unsigned int pion::http::types::RESPONSE_CODE_SERVER_ERROR = 500
static
const unsigned int pion::http::types::RESPONSE_CODE_UNAUTHORIZED = 401
static
const std::string pion::http::types::RESPONSE_MESSAGE_ACCEPTED
static
const std::string pion::http::types::RESPONSE_MESSAGE_BAD_REQUEST
static
const std::string pion::http::types::RESPONSE_MESSAGE_CONTINUE
static
const std::string pion::http::types::RESPONSE_MESSAGE_CREATED
static
const std::string pion::http::types::RESPONSE_MESSAGE_FORBIDDEN
static
const std::string pion::http::types::RESPONSE_MESSAGE_FOUND
static
const std::string pion::http::types::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED
static
const std::string pion::http::types::RESPONSE_MESSAGE_NO_CONTENT
static
const std::string pion::http::types::RESPONSE_MESSAGE_NOT_FOUND
static
const std::string pion::http::types::RESPONSE_MESSAGE_NOT_IMPLEMENTED
static
const std::string pion::http::types::RESPONSE_MESSAGE_NOT_MODIFIED
static
const std::string pion::http::types::RESPONSE_MESSAGE_OK
static
const std::string pion::http::types::RESPONSE_MESSAGE_SERVER_ERROR
static
const std::string pion::http::types::RESPONSE_MESSAGE_UNAUTHORIZED
static
const std::string pion::http::types::STRING_CRLF
static
const std::string pion::http::types::STRING_EMPTY
static
const std::string pion::http::types::STRING_HTTP_VERSION
static

The documentation for this struct was generated from the following files: