#include <webclient.hh>
Public Types | |
|
typedef std::map< std::string, std::string, header_sort > | header_type |
| header type (name/token) | |
Public Member Functions | |
| http_request () | |
| http_request (const char *url, const char *addr, int port=80) | |
| ~http_request () | |
| bool | open (const char *addr, int port=80) |
| void | close () |
| bool | request (const char *url) |
| send request and wait for answer | |
| bool | request (const char *url, const char *addr, int port=80) |
| const header_type & | header () const |
| Get header. | |
| int | size () const |
| Get content length. | |
| char * | data () |
| Get content pointer. | |
Static Public Member Functions | |
| static std::string | mangle (const std::string &s) |
| static std::string | demangle (const std::string &s) |
Protected Member Functions | |
| bool | sendRequest (const char *url) |
| send an http request | |
| bool | recvHeader () |
| receive the header of the response | |
| bool | recvContent () |
| receive the content | |
| bool | uncompress () |
| uncompress the content | |
Protected Attributes | |
| header_type | fHeader |
| header | |
| char * | fData |
| Data. | |
| int | fLen |
| Data length. | |
| int | fFill |
| filled data | |
| int | fSock |
| Socket. | |
Classes | |
| class | header_sort |
| Header sort order. More... | |
brief web server access class
| web::http_request::http_request | ( | ) |
Default constructor. brief Default constructor
| web::http_request::http_request | ( | const char * | url, | |
| const char * | addr, | |||
| int | port = 80 | |||
| ) |
Constructor. Open connection, send request and wait for answer. brief Open connection, send request and wait for answer
| url | URL string | |
| addr | Web server address | |
| port | Web server port number |
| web::http_request::~http_request | ( | ) |
Destructor. brief Destructor
| bool web::http_request::open | ( | const char * | addr, | |
| int | port = 80 | |||
| ) |
Open connection. brief Open connection
| addr | Web server address | |
| port | Web server port number |
| void web::http_request::close | ( | ) |
Close connection. brief Close connection
| bool web::http_request::request | ( | const char * | url | ) |
send request and wait for answer
Send request and wait for answer. brief Send request and wait for answer
| url | URL string |
| bool web::http_request::request | ( | const char * | url, | |
| const char * | addr, | |||
| int | port = 80 | |||
| ) |
Open connection, send request and wait for answer. brief Open connection, send request and wait for answer
| url | URL string | |
| addr | Web server address | |
| port | Web server port number |
| static std::string web::http_request::mangle | ( | const std::string & | s | ) | [static] |
Mangle a string to escape control characters. brief Mangle
| s | input string |
| static std::string web::http_request::demangle | ( | const std::string & | s | ) | [static] |
Demangle a string to unescape control characters. brief Demangle
| s | input string |
1.5.4