ZenLib

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

Classes | Macros | Typedefs | Functions
HTTPClient.h File Reference
`#include "HTTPClientWrapper.h"`
`#include "HTTPClientCommon.h"`

Go to the source code of this file.

## Classes
struct | _HTTP_PARAM
struct | _HTTP_CONNECTION
struct | _HTTP_URL
struct | _HTTP_HEADERS
struct | _HTTP_HEADERS_INFO
struct | _HTTP_AUTH_HEADER
struct | _HTTP_PROXY
struct | _HTTP_CREDENTIALS
struct | _HTTP_COUNTERS
struct | _HTTP_REQUEST

## Macros
#define | HTTP_CLIENT_VERSION_MINOR 0
#define | HTTP_CLIENT_VERSION_MAJOR 1
#define | HTTP_CLIENT_MAX_SEND_RECV_HEADERS 1024
#define | HTTP_CLIENT_INIT_SEND_RECV_HEADERS 2048
#define | HTTP_CLIENT_MAX_USERNAME_LENGTH 16
#define | HTTP_CLIENT_MAX_PASSWORD_LENGTH 16
#define | HTTP_CLIENT_MAX_64_ENCODED_CRED ((HTTP_CLIENT_MAX_USERNAME_LENGTH + HTTP_CLIENT_MAX_PASSWORD_LENGTH) * 2) + 4
#define | HTTP_CLIENT_MAX_CHUNK_HEADER 64
#define | HTTP_CLIENT_MAX_PROXY_HOST_LENGTH 64
#define | HTTP_CLIENT_MAX_TOKEN_LENGTH 512
#define | HTTP_CLIENT_MAX_TOKEN_NAME_LENGTH 32
#define | HTTP_CLIENT_MAX_HEADER_SEARCH_CLUE 1024
#define | HTTP_CLIENT_ALLOW_HEAD_VERB 0
#define | HTTP_CLIENT_MEMORY_RESIZABLE FALSE
#define | HTTP_CLIENT_MEMORY_RESIZE_FACTOR 16
#define | HTTP_CLIENT_DEFAULT_PORT 80
#define | HTTP_CLIENT_DEFAULT_SSL_PORT 443
#define | HTTP_CLIENT_DEFAULT_VERB 0
#define | HTTP_CLIENT_DEFAULT_VER "HTTP/1.1"
#define | HTTP_CLIENT_DEFAULT_PROXY_VER "HTTP/1.0"
#define | HTTP_CLIENT_DEFAULT_AGENT "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
#define | HTTP_CLIENT_DEFAULT_TIMEOUT 30
#define | HTTP_CLIENT_DEFAULT_KEEP_ALIVE 30
#define | HTTP_CLIENT_DEFAULT_DIGEST_AUTH "MD5"
#define | HTTP_CLIENT_DEFAULT_PROXY_AUTH 1
#define | HTTP_CLIENT_CRLF "\r\n"
#define | HTTP_CLIENT_CRLFX2 "\r\n\r\n"
#define | HTTP_CLIENT_FLAG_SECURE 0x00000010
#define | HTTP_CLIENT_FLAG_URLANDPORT 0x00000020
#define | HTTP_CLIENT_FLAG_URLHTTPS 0x00000040
#define | HTTP_CLIENT_FLAG_USINGPROXY 0x00000080
#define | HTTP_CLIENT_FLAG_CHUNKED 0x00000100
#define | HTTP_STATUS_OK 200
#define | HTTP_STATUS_UNAUTHORIZED 401
#define | HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED 407
#define | HTTP_STATUS_OBJECT_MOVED 302
#define | HTTP_STATUS_OBJECT_MOVED_PERMANENTLY 301
#define | HTTP_STATUS_CONTINUE 100
#define | MIN(a, b) (((a) < (b)) ? (a) : (b))
#define | MAX(a, b) (((a) > (b)) ? (a) : (b))
#define | HTTP_TIMEOUT(nTimeout) (((nTimeout) > (0)) ? (nTimeout) : (HTTP_CLIENT_DEFAULT_TIMEOUT))
#define | ALIGN(size) ((size & 0xfffffffc) + ((size & 3) ? 4 : 0))

## Typedefs
typedef struct _HTTP_PARAM | HTTP_PARAM
typedef struct _HTTP_CONNECTION | HTTP_CONNECTION
typedef struct _HTTP_URL | HTTP_URL
typedef struct _HTTP_HEADERS | HTTP_HEADERS
typedef struct _HTTP_HEADERS_INFO | HTTP_HEADERS_INFO
typedef struct _HTTP_AUTH_HEADER | HTTP_AUTH_HEADER
typedef struct _HTTP_PROXY | HTTP_PROXY
typedef struct _HTTP_CREDENTIALS | HTTP_CREDENTIALS
typedef struct _HTTP_COUNTERS | HTTP_COUNTERS
typedef struct _HTTP_REQUEST | HTTP_SESSION
typedef struct _HTTP_REQUEST * | P_HTTP_SESSION
typedef UINT32 | HTTP_SESSION_HANDLE
typedef UINT32 | HTTP_CLIENT_SESSION_FLAGS

## Functions
HTTP_SESSION_HANDLE | HTTPClientOpenRequest (HTTP_CLIENT_SESSION_FLAGS Flags)
UINT32 | HTTPClientCloseRequest (HTTP_SESSION_HANDLE *pSession)
UINT32 | HTTPClientSetLocalConnection (HTTP_SESSION_HANDLE pSession, UINT32 nPort)
UINT32 | HTTPClientSetAuth (HTTP_SESSION_HANDLE pSession, HTTP_AUTH_SCHEMA AuthSchema, void *pReserved)
UINT32 | HTTPClientSetCredentials (HTTP_SESSION_HANDLE pSession, CHAR *pUserName, CHAR *pPassword)
UINT32 | HTTPClientSetProxy (HTTP_SESSION_HANDLE pSession, CHAR *pProxyName, UINT16 nPort, CHAR *pUserName, CHAR *pPassword)
UINT32 | HTTPClientSetVerb (HTTP_SESSION_HANDLE pSession, HTTP_VERB HttpVerb)
UINT32 | HTTPClientAddRequestHeaders (HTTP_SESSION_HANDLE pSession, CHAR *pHeaderName, CHAR *pHeaderData, BOOL nInsert)
UINT32 | HTTPClientSendRequest (HTTP_SESSION_HANDLE pSession, CHAR *pUrl, VOID *pData, UINT32 nDataLength, BOOL TotalLength, UINT32 nTimeout, UINT32 nClientPort)
UINT32 | HTTPClientWriteData (HTTP_SESSION_HANDLE pSession, VOID *pBuffer, UINT32 nBufferLength, UINT32 nTimeout)
UINT32 | HTTPClientRecvResponse (HTTP_SESSION_HANDLE pSession, UINT32 nTimeout)
UINT32 | HTTPClientReadData (HTTP_SESSION_HANDLE pSession, VOID *pBuffer, UINT32 nBytesToRead, UINT32 nTimeout, UINT32 *nBytesRecived)
UINT32 | HTTPClientGetInfo (HTTP_SESSION_HANDLE pSession, HTTP_CLIENT *HTTPClient)
UINT32 | HTTPClientFindFirstHeader (HTTP_SESSION_HANDLE pSession, CHAR *pSearchClue, CHAR *pHeaderBuffer, UINT32 *nLength)
UINT32 | HTTPClientGetNextHeader (HTTP_SESSION_HANDLE pSession, CHAR *pHeaderBuffer, UINT32 *nLength)
UINT32 | HTTPClientFindCloseHeader (HTTP_SESSION_HANDLE pSession)
UINT32 | HTTPIntrnResizeBuffer (P_HTTP_SESSION pHTTPSession, UINT32 nNewSize)
UINT32 | HTTPIntrnSetURL (P_HTTP_SESSION pHTTPSession, CHAR *pUrl, UINT32 nUrlLength)
UINT32 | HTTPIntrnConnectionClose (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnConnectionOpen (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnGetRemoteHeaders (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnGetRemoteChunkLength (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnSend (P_HTTP_SESSION pHTTPSession, CHAR *pData, UINT32 *nLength)
UINT32 | HTTPIntrnRecv (P_HTTP_SESSION pHTTPSession, CHAR *pData, UINT32 *nLength, BOOL PeekOnly)
UINT32 | HTTPIntrnParseAuthHeader (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnAuthHandler (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnAuthSendDigest (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnAuthSendBasic (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnAuthenticate (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnHeadersAdd (P_HTTP_SESSION pHTTPSession, CHAR *pHeaderName, UINT32 nNameLength, CHAR *pHeaderData, UINT32 nDataLength)
UINT32 | HTTPIntrnHeadersRemove (P_HTTP_SESSION pHTTPSession, CHAR *pHeaderName)
UINT32 | HTTPIntrnHeadersReceive (P_HTTP_SESSION pHTTPSession, UINT32 nTimeout)
UINT32 | HTTPIntrnHeadersSend (P_HTTP_SESSION pHTTPSession, HTTP_VERB HttpVerb)
UINT32 | HTTPIntrnHeadersParse (P_HTTP_SESSION pHTTPSession)
UINT32 | HTTPIntrnHeadersFind (P_HTTP_SESSION pHTTPSession, CHAR *pHeaderName, HTTP_PARAM *pParam, BOOL IncommingHeaders, UINT32 nOffset)
UINT32 | HTTPIntrnSessionReset (P_HTTP_SESSION pHTTPSession, BOOL EntireSession)
UINT32 | HTTPIntrnSessionGetUpTime (VOID)
BOOL | HTTPIntrnSessionEvalTimeout (P_HTTP_SESSION pHTTPSession)

## Macro Definition Documentation

#define ALIGN | ( |  | size | ) | ((size & 0xfffffffc) + ((size & 3) ? 4 : 0))

#define HTTP_CLIENT_ALLOW_HEAD_VERB 0

#define HTTP_CLIENT_CRLF "\r\n"

#define HTTP_CLIENT_CRLFX2 "\r\n\r\n"

#define HTTP_CLIENT_DEFAULT_AGENT "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"

#define HTTP_CLIENT_DEFAULT_DIGEST_AUTH "MD5"

#define HTTP_CLIENT_DEFAULT_KEEP_ALIVE 30

#define HTTP_CLIENT_DEFAULT_PORT 80

#define HTTP_CLIENT_DEFAULT_PROXY_AUTH 1

#define HTTP_CLIENT_DEFAULT_PROXY_VER "HTTP/1.0"

#define HTTP_CLIENT_DEFAULT_SSL_PORT 443

#define HTTP_CLIENT_DEFAULT_TIMEOUT 30

#define HTTP_CLIENT_DEFAULT_VER "HTTP/1.1"

#define HTTP_CLIENT_DEFAULT_VERB 0

#define HTTP_CLIENT_FLAG_CHUNKED 0x00000100

#define HTTP_CLIENT_FLAG_SECURE 0x00000010

#define HTTP_CLIENT_FLAG_URLANDPORT 0x00000020

#define HTTP_CLIENT_FLAG_URLHTTPS 0x00000040

#define HTTP_CLIENT_FLAG_USINGPROXY 0x00000080

#define HTTP_CLIENT_INIT_SEND_RECV_HEADERS 2048

#define HTTP_CLIENT_MAX_64_ENCODED_CRED ((HTTP_CLIENT_MAX_USERNAME_LENGTH + HTTP_CLIENT_MAX_PASSWORD_LENGTH) * 2) + 4

#define HTTP_CLIENT_MAX_CHUNK_HEADER 64

#define HTTP_CLIENT_MAX_HEADER_SEARCH_CLUE 1024

#define HTTP_CLIENT_MAX_PASSWORD_LENGTH 16

#define HTTP_CLIENT_MAX_PROXY_HOST_LENGTH 64

#define HTTP_CLIENT_MAX_SEND_RECV_HEADERS 1024

#define HTTP_CLIENT_MAX_TOKEN_LENGTH 512

#define HTTP_CLIENT_MAX_TOKEN_NAME_LENGTH 32

#define HTTP_CLIENT_MAX_USERNAME_LENGTH 16

#define HTTP_CLIENT_MEMORY_RESIZABLE FALSE

#define HTTP_CLIENT_MEMORY_RESIZE_FACTOR 16

#define HTTP_CLIENT_VERSION_MAJOR 1

#define HTTP_CLIENT_VERSION_MINOR 0

#define HTTP_STATUS_CONTINUE 100

#define HTTP_STATUS_OBJECT_MOVED 302

#define HTTP_STATUS_OBJECT_MOVED_PERMANENTLY 301

#define HTTP_STATUS_OK 200

#define HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED 407

#define HTTP_STATUS_UNAUTHORIZED 401

#define HTTP_TIMEOUT | ( |  | nTimeout | ) | (((nTimeout) > (0)) ? (nTimeout) : (HTTP_CLIENT_DEFAULT_TIMEOUT))

#define MAX | ( |  | a,
|  |  | b
| ) |  | (((a) > (b)) ? (a) : (b))

#define MIN | ( |  | a,
|  |  | b
| ) |  | (((a) < (b)) ? (a) : (b))

## Typedef Documentation

typedef struct _HTTP_AUTH_HEADER HTTP_AUTH_HEADER

typedef UINT32 HTTP_CLIENT_SESSION_FLAGS

typedef struct _HTTP_CONNECTION HTTP_CONNECTION

typedef struct _HTTP_COUNTERS HTTP_COUNTERS

typedef struct _HTTP_CREDENTIALS HTTP_CREDENTIALS

typedef struct _HTTP_HEADERS HTTP_HEADERS

typedef struct _HTTP_HEADERS_INFO HTTP_HEADERS_INFO

typedef struct _HTTP_PARAM HTTP_PARAM

typedef struct _HTTP_PROXY HTTP_PROXY

typedef struct _HTTP_REQUEST HTTP_SESSION

typedef UINT32 HTTP_SESSION_HANDLE

typedef struct _HTTP_URL HTTP_URL

typedef struct _HTTP_REQUEST * P_HTTP_SESSION

## Function Documentation

UINT32 HTTPClientAddRequestHeaders | ( | HTTP_SESSION_HANDLE | pSession,
|  | CHAR * | pHeaderName,
|  | CHAR * | pHeaderData,
|  | BOOL | nInsert
| ) |  |

UINT32 HTTPClientCloseRequest | ( | HTTP_SESSION_HANDLE * | pSession | ) |

UINT32 HTTPClientFindCloseHeader | ( | HTTP_SESSION_HANDLE | pSession | ) |

UINT32 HTTPClientFindFirstHeader | ( | HTTP_SESSION_HANDLE | pSession,
|  | CHAR * | pSearchClue,
|  | CHAR * | pHeaderBuffer,
|  | UINT32 * | nLength
| ) |  |

UINT32 HTTPClientGetInfo | ( | HTTP_SESSION_HANDLE | pSession,
|  | HTTP_CLIENT * | HTTPClient
| ) |  |

UINT32 HTTPClientGetNextHeader | ( | HTTP_SESSION_HANDLE | pSession,
|  | CHAR * | pHeaderBuffer,
|  | UINT32 * | nLength
| ) |  |

HTTP_SESSION_HANDLE HTTPClientOpenRequest | ( | HTTP_CLIENT_SESSION_FLAGS | Flags | ) |

UINT32 HTTPClientReadData | ( | HTTP_SESSION_HANDLE | pSession,
|  | VOID * | pBuffer,
|  | UINT32 | nBytesToRead,
|  | UINT32 | nTimeout,
|  | UINT32 * | nBytesRecived
| ) |  |

UINT32 HTTPClientRecvResponse | ( | HTTP_SESSION_HANDLE | pSession,
|  | UINT32 | nTimeout
| ) |  |

UINT32 HTTPClientSendRequest | ( | HTTP_SESSION_HANDLE | pSession,
|  | CHAR * | pUrl,
|  | VOID * | pData,
|  | UINT32 | nDataLength,
|  | BOOL | TotalLength,
|  | UINT32 | nTimeout,
|  | UINT32 | nClientPort
| ) |  |

UINT32 HTTPClientSetAuth | ( | HTTP_SESSION_HANDLE | pSession,
|  | HTTP_AUTH_SCHEMA | AuthSchema,
|  | void * | pReserved
| ) |  |

UINT32 HTTPClientSetCredentials | ( | HTTP_SESSION_HANDLE | pSession,
|  | CHAR * | pUserName,
|  | CHAR * | pPassword
| ) |  |

UINT32 HTTPClientSetLocalConnection | ( | HTTP_SESSION_HANDLE | pSession,
|  | UINT32 | nPort
| ) |  |

UINT32 HTTPClientSetProxy | ( | HTTP_SESSION_HANDLE | pSession,
|  | CHAR * | pProxyName,
|  | UINT16 | nPort,
|  | CHAR * | pUserName,
|  | CHAR * | pPassword
| ) |  |

UINT32 HTTPClientSetVerb | ( | HTTP_SESSION_HANDLE | pSession,
|  | HTTP_VERB | HttpVerb
| ) |  |

UINT32 HTTPClientWriteData | ( | HTTP_SESSION_HANDLE | pSession,
|  | VOID * | pBuffer,
|  | UINT32 | nBufferLength,
|  | UINT32 | nTimeout
| ) |  |

UINT32 HTTPIntrnAuthenticate | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnAuthHandler | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnAuthSendBasic | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnAuthSendDigest | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnConnectionClose | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnConnectionOpen | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnGetRemoteChunkLength | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnGetRemoteHeaders | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnHeadersAdd | ( | P_HTTP_SESSION | pHTTPSession,
|  | CHAR * | pHeaderName,
|  | UINT32 | nNameLength,
|  | CHAR * | pHeaderData,
|  | UINT32 | nDataLength
| ) |  |

UINT32 HTTPIntrnHeadersFind | ( | P_HTTP_SESSION | pHTTPSession,
|  | CHAR * | pHeaderName,
|  | HTTP_PARAM * | pParam,
|  | BOOL | IncommingHeaders,
|  | UINT32 | nOffset
| ) |  |

UINT32 HTTPIntrnHeadersParse | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnHeadersReceive | ( | P_HTTP_SESSION | pHTTPSession,
|  | UINT32 | nTimeout
| ) |  |

UINT32 HTTPIntrnHeadersRemove | ( | P_HTTP_SESSION | pHTTPSession,
|  | CHAR * | pHeaderName
| ) |  |

UINT32 HTTPIntrnHeadersSend | ( | P_HTTP_SESSION | pHTTPSession,
|  | HTTP_VERB | HttpVerb
| ) |  |

UINT32 HTTPIntrnParseAuthHeader | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnRecv | ( | P_HTTP_SESSION | pHTTPSession,
|  | CHAR * | pData,
|  | UINT32 * | nLength,
|  | BOOL | PeekOnly
| ) |  |

UINT32 HTTPIntrnResizeBuffer | ( | P_HTTP_SESSION | pHTTPSession,
|  | UINT32 | nNewSize
| ) |  |

UINT32 HTTPIntrnSend | ( | P_HTTP_SESSION | pHTTPSession,
|  | CHAR * | pData,
|  | UINT32 * | nLength
| ) |  |

BOOL HTTPIntrnSessionEvalTimeout | ( | P_HTTP_SESSION | pHTTPSession | ) |

UINT32 HTTPIntrnSessionGetUpTime | ( | VOID |  | ) |

UINT32 HTTPIntrnSessionReset | ( | P_HTTP_SESSION | pHTTPSession,
|  | BOOL | EntireSession
| ) |  |

UINT32 HTTPIntrnSetURL | ( | P_HTTP_SESSION | pHTTPSession,
|  | CHAR * | pUrl,
|  | UINT32 | nUrlLength
| ) |  |