|
| PHTTPClient (const PString &userAgentName=PString::Empty()) |
| Create a new HTTP client channel. More...
|
|
int | ExecuteCommand (Commands cmd, const PURL &url, PMIMEInfo &outMIME, const PString &dataBody, PMIMEInfo &replyMime) |
| Send a command and wait for the response header (including MIME fields). More...
|
|
int | ExecuteCommand (const PString &cmdName, const PURL &url, PMIMEInfo &outMIME, const PString &dataBody, PMIMEInfo &replyMime) |
|
bool | WriteCommand (Commands cmd, const PString &url, PMIMEInfo &outMIME, const PString &dataBody) |
| Write a HTTP command to server. More...
|
|
bool | WriteCommand (const PString &cmdName, const PString &url, PMIMEInfo &outMIME, const PString &dataBody) |
|
bool | ReadResponse (PMIMEInfo &replyMIME) |
| Read a response from the server. More...
|
|
bool | ReadContentBody (PMIMEInfo &replyMIME, ContentProcessor &processor) |
| Read the body of the HTTP command. More...
|
|
bool | ReadContentBody (PMIMEInfo &replyMIME) |
| Read the body of the HTTP command, throwing it away. More...
|
|
bool | ReadContentBody (PMIMEInfo &replyMIME, PString &body) |
| Read the body of the HTTP command as a string. More...
|
|
bool | ReadContentBody (PMIMEInfo &replyMIME, PBYTEArray &body) |
| Read the body of the HTTP command as a binary block. More...
|
|
bool | GetDocument (const PURL &url, ContentProcessor &processor) |
| Start getting the document specified by the URL. More...
|
|
bool | GetDocument (const PURL &url, PMIMEInfo &outMIME, PMIMEInfo &replyMIME) |
| Start getting the document specified by the URL. More...
|
|
bool | GetDocument (const PURL &url, PMIMEInfo &replyMIME) |
|
bool | GetTextDocument (const PURL &url, PString &document, const PString &contentType=PString::Empty()) |
| Get the document specified by the URL. More...
|
|
bool | GetBinaryDocument (const PURL &url, PBYTEArray &document, const PString &contentType=PString::Empty()) |
| Get the document specified by the URL. More...
|
|
bool | GetHeader (const PURL &url, PMIMEInfo &outMIME, PMIMEInfo &replyMIME) |
| Get the header for the document specified by the URL. More...
|
|
bool | GetHeader (const PURL &url, PMIMEInfo &replyMIME) |
|
bool | PostData (const PURL &url, const PStringToString &data) |
| Post the "application/x-www-form-urlencoded" data specified to the URL. More...
|
|
bool | PostData (const PURL &url, PMIMEInfo &outMIME, const PString &data) |
| Post the data specified to the URL. More...
|
|
bool | PostData (const PURL &url, PMIMEInfo &outMIME, const PString &data, PMIMEInfo &replyMIME) |
| Start a post of the data specified to the URL. More...
|
|
bool | PostData (const PURL &url, PMIMEInfo &outMIME, const PString &data, PMIMEInfo &replyMIME, PString &replyBody) |
| Post the data specified to the URL. More...
|
|
bool | PutTextDocument (const PURL &url, const PString &document, const PString &contentType=PMIMEInfo::TextPlain()) |
| Put the document specified by the URL. More...
|
|
bool | PutDocument (const PURL &url, PMIMEInfo &outMIME, PMIMEInfo &replyMIME) |
| Put the document specified by the URL. More...
|
|
bool | DeleteDocument (const PURL &url) |
| Delete the document specified by the URL. More...
|
|
void | SetAuthenticationInfo (const PString &userName, const PString &password) |
| Set authentication paramaters to be use for retreiving documents. More...
|
|
void | SetPersistent (bool persist=true) |
| Set persistent connection mode. More...
|
|
bool | GetPersistent () const |
| Get persistent connection mode. More...
|
|
|
enum | Commands {
GET,
HEAD,
POST,
PUT,
DELETE,
TRACE,
OPTIONS,
CONNECT,
NumCommands
} |
|
enum | StatusCode {
BadResponse = 1,
ContentProcessorError,
UnknownTransferEncoding,
Continue = 100,
SwitchingProtocols,
RequestOK = 200,
Created,
Accepted,
NonAuthoritativeInformation,
NoContent,
ResetContent,
PartialContent,
MultipleChoices = 300,
MovedPermanently,
MovedTemporarily,
SeeOther,
NotModified,
UseProxy,
BadRequest = 400,
UnAuthorised,
PaymentRequired,
Forbidden,
NotFound,
MethodNotAllowed,
NoneAcceptable,
ProxyAuthenticationRequired,
RequestTimeout,
Conflict,
Gone,
LengthRequired,
UnlessTrue,
InternalServerError = 500,
NotImplemented,
BadGateway,
ServiceUnavailable,
GatewayTimeout
} |
|
static const PCaselessString & | HostTag () |
|
static const PCaselessString & | AllowTag () |
|
static const PCaselessString & | AuthorizationTag () |
|
static const PCaselessString & | ContentEncodingTag () |
|
static const PCaselessString & | ContentLengthTag () |
|
static const PCaselessString & | ContentTypeTag () |
|
static const PCaselessString & | DateTag () |
|
static const PCaselessString & | ExpiresTag () |
|
static const PCaselessString & | FromTag () |
|
static const PCaselessString & | IfModifiedSinceTag () |
|
static const PCaselessString & | LastModifiedTag () |
|
static const PCaselessString & | LocationTag () |
|
static const PCaselessString & | PragmaTag () |
|
static const PCaselessString & | PragmaNoCacheTag () |
|
static const PCaselessString & | RefererTag () |
|
static const PCaselessString & | ServerTag () |
|
static const PCaselessString & | UserAgentTag () |
|
static const PCaselessString & | WWWAuthenticateTag () |
|
static const PCaselessString & | MIMEVersionTag () |
|
static const PCaselessString & | ConnectionTag () |
|
static const PCaselessString & | KeepAliveTag () |
|
static const PCaselessString & | UpgradeTag () |
|
static const PCaselessString & | WebSocketTag () |
|
static const PCaselessString & | WebSocketKeyTag () |
|
static const PCaselessString & | WebSocketAcceptTag () |
|
static const PCaselessString & | WebSocketProtocolTag () |
|
static const PCaselessString & | WebSocketVersionTag () |
|
static const PCaselessString & | TransferEncodingTag () |
|
static const PCaselessString & | ChunkedTag () |
|
static const PCaselessString & | ProxyConnectionTag () |
|
static const PCaselessString & | ProxyAuthorizationTag () |
|
static const PCaselessString & | ProxyAuthenticateTag () |
|
static const PCaselessString & | ForwardedTag () |
|
static const PCaselessString & | SetCookieTag () |
|
static const PCaselessString & | CookieTag () |
|
enum | StuffState {
DontStuff,
StuffIdle,
StuffCR,
StuffCRLF,
StuffCRLFdot,
StuffCRLFdotCR
} |
|
A TCP/IP socket for the HyperText Transfer Protocol version 1.0.
When acting as a client, the procedure is to make the connection to a remote server, then to retrieve a document using the following procedure:
PHTTPSocket web("webserver");
if (web.IsOpen()) {
PINDEX len;
if (web.GetDocument("http://www.someone.com/somewhere/url", len)) {
PString html = web.ReadString(len);
if (!html.IsEmpty())
ProcessHTML(html);
}
else
PError << "Could not get page." << endl;
}
else
PError << "HTTP conection failed." << endl;