CkHttp C++ Class Reference

CkHttp

Class for sending HTTP requests and receiving server responses.

  • Supports GET, POST, HEAD, PUT, DELETE, WebDav, and custom HTTP request methods.
  • HTTP Authentication: Basic, NTLM, Digest, Negotiate
  • HTTPS (SSL/TLS) with client-side certificate capabilities.
  • Cookie caching, auto-resend, persisting to XML files.
  • Content caching.
  • Supports HTTP proxies
  • Auto-follow redirects if desired.
  • Amazon S3 methods.
  • XML HTTP Request
  • HTTP file upload capabilities
  • Asynchronous features -- putting HTTP requests in background threads.
  • Supports SOCK5/SOCKS4 proxies.
  • IPv6 capable.

Properties

void get_Accept(CkString &str);
void put_Accept(const char *v);

The Accept header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "*/*".

void get_AcceptCharset(CkString &str);
void put_AcceptCharset(const char *v);

The AcceptCharset header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "ISO-8859-1,utf-8;q=0.7,*;q=0.7".

void get_AcceptLanguage(CkString &str);
void put_AcceptLanguage(const char *v);

The AcceptLanguage header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "en-us,en;q=0.5".

bool get_AllowGzip(void);
void put_AllowGzip(bool newVal);

Controls whether the "Accept-Encoding: gzip" header is added to HTTP requests sent via any method that sends an HTTP request without using the HttpRequest object (such as QuickGetStr). If false, then the empty Accept-Encoding header is added which means the server response should contain the uncompressed content. The default value is true, which means the server, if it chooses, may send a gzipped response.

bool get_AutoAddHostHeader(void);
void put_AutoAddHostHeader(bool b);

If set to true, the "Host" header field will automatically be added to the request header for any QuickGet or QuickGetStr method calls. The value of the Host header field is taken from the hostname part of the URL passed to QuickGet/QuickGetStr.

void get_AwsAccessKey(CkString &str);
void put_AwsAccessKey(const char *newVal);

To be documented soon...

void get_AwsSecretKey(CkString &str);
void put_AwsSecretKey(const char *newVal);

To be documented soon...

void get_BgLastErrorText(CkString &str);

When a background-enabled method is run asynchronously in a background thread, the last-error information is saved here and not in the LastErrorText property. If the background method fails, this will contain information about what transpired. (This property also contains information when the background method succeeds.)

More information on background enabling HTTP communications.

Example for background thread HTTP Download.

int get_BgPercentDone(void);

To be documented soon...

void get_BgResultData(CkByteData &data);

If a backgrounded method returns a byte array, the returned data is found here.

int get_BgResultInt(void);

If a backgrounded method returns an integer, the return value is found here.

void get_BgResultString(CkString &str);

If a backgrounded method returns a string, the return value is found here.

bool get_BgTaskFinished(void);

Becomes true when the background method completes. Your application would periodically check for this condition.

More information on background enabling HTTP communications.

Example for background thread HTTP Download.

bool get_BgTaskRunning(void);

If true then the object instance already has a backgrounded method running. Another backgrounded method cannot be started until the 1st completes. (Multiple simultaneous background methods may run by using multiple object instances.)

If false, then no method is currently running in a background thread.

More information on background enabling HTTP communications.

Example for background thread HTTP Download.

bool get_BgTaskSuccess(void);

This property's value is only meaningful (true or false) after a backgrounded method completes.

More information on background enabling HTTP communications.

Example for background thread HTTP Download.

void get_ClientIpAddress(CkString &str);
void put_ClientIpAddress(const char *newVal);

The IP address to use for computers with multiple network interfaces or IP addresses. For computers with a single network interface (i.e. most computers), this property should not be set. For multihoming computers, the default IP address is automatically used if this property is not set.

The IP address is a string such as in dotted notation using numbers, not domain names, such as "165.164.55.124".

Important Bind to Adapter Notes for Windows

long get_ConnectTimeout(void);
void put_ConnectTimeout(long numSeconds);

The amount of time in seconds to wait before timing out when connecting to an HTTP server.

void get_Connection(CkString &str);
void put_Connection(const char *v);

The Connection header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "Keep-Alive". To prevent the Connection header from being added to the HTTP header, set this property to the empty string.

void get_CookieDir(CkString &str);
void put_CookieDir(const char *dir);

Specifies a directory where cookies are automatically persisted if the Http.SaveCookies property is turned on. Cookies are stored in XML formatted files, one per domain, to main it easy for other programs to understand and parse. May be set to the string "memory" to cache cookies in memory.

Saving Cookies to XML Files

Caching cookies in-memory.

void get_DebugLogFilePath(CkString &str);
void put_DebugLogFilePath(const char *newVal);

Used for debugging in cases where a Chilkat method call hangs and never returns. This should generally never happen. The only causes for this are (1) a timeout related property was set to 0 to explicitly indicate that an infinite timeout is desired, (2) the hang is actually a hang within an event callback (i.e. it is a hang within the application code), or (3) there is an internal problem (bug) in the Chilkat code that causes the hang.

This property allows one to specifiy a debug file path that will be created (or appended if it already exists) and information will be logged to it as the Chilkat methods are called. If a hang occurs, the log file may be viewed to get information about what happened.

long get_DefaultFreshPeriod(void);
void put_DefaultFreshPeriod(long numMinutes);

The default freshness period (in minutes) for cached documents when the FreshnessAlgorithm property is set to 0. The default value is 10080 (1 week).

bool get_DigestAuth(void);
void put_DigestAuth(bool newVal);

Setting this property to true causes the HTTP component to use digest authentication. The default value is false.

HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)

int get_EventLogCount(void);

If the KeepEventLog property is set to true, then this property will contain the number of events that have accumulated in the in-memory event log. The events are indexed from 0 to EventLogCount-1. The ClearEventLog method may be called to clear the event log. The name and value of each event can be retrieved via the EventLogName and EventLogValue methods.

bool get_FetchFromCache(void);
void put_FetchFromCache(bool b);

Set to true if pages should be fetched from cache when possible. Only HTTP GET requests are cached. HTTP responses that include Set-Cookie headers are not cached. A page is fetched from the disk cache if it is present and it is "fresh" according to the FreshnessAlgorithm property. If a page exists in cache but is not fresh, the HTTP component will issue a revalidate request and update the cache appropriately according to the response.

void get_FinalRedirectUrl(CkString &str);

If an HTTP GET was redirected (as indicated by the WasRedirected property), this property will contain the final redirect URL, assuming the FollowRedirects property is true.

Tracing HTTP Redirects

bool get_FollowRedirects(void);
void put_FollowRedirects(bool b);

If true, then 301 and 302 redirects are automatically followed when calling QuickGet and QuickGetStr. FollowRedirects is true by default.

long get_FreshnessAlgorithm(void);
void put_FreshnessAlgorithm(long v);

The freshness algorithm to use when determining the freshness of a cached HTTP GET response. A value of 1 causes an LM-factor algorithm to be used. This is the default. The LMFactor property is a value between 1 and 100 indicating the percentage of time based on the last-modified date of the HTML page. For example, if the LMFactor is 50, and an HTML page was modified 10 days ago, then the page will expire (i.e. no longer be fresh) in 5 days (50% of 10 days). This only applies to HTTP responses that do not have page expiration information. If the FreshnessAlgorithm = 0, then a constant expire time period determined by the DefaultFreshPeriod property is used.

long get_HeartbeatMs(void);
void put_HeartbeatMs(long newVal);

When set to a non-zero value, it specifies the time interval in milliseconds between AbortCheck events. Any HTTP operation can be aborted via the AbortCheck event. Event callbacks are supported for ActiveX, .NET, and C++ implementations of this API.

bool get_IgnoreMustRevalidate(void);
void put_IgnoreMustRevalidate(bool b);

Some HTTP responses contain a "Cache-Control: must-revalidate" header. If this is present, the server is requesting that the client always issue a revalidate HTTP request instead of serving the page directly from cache. If IgnoreMustRevalidate is set to true, then Chilkat HTTP will serve the page directly from cache without revalidating until the page is no longer fresh.

The default value of this property is false.

bool get_IgnoreNoCache(void);
void put_IgnoreNoCache(bool b);

Some HTTP responses contain headers of various types that indicate that the page should not be cached. Chilkat HTTP will adhere to this unless this property is set to true.

The default value of this property is false.

bool get_KeepEventLog(void);
void put_KeepEventLog(bool newVal);

If true, an in-memory event log is kept for any method that communicates with an HTTP server (such as Download, PostUrlEncoded, QuickGetStr, SynchronousRequest, etc.). When HTTP methods are called asynchronously, the event log can be checked while the HTTP operation is in in progress. This is done by examining the EventLogCount property and then fetching each event's name and value via the EventLogName and EventLogValue methods. See this example: Asynchronous HTTP.

The ClearBgEventLog method may be called to clear the in-memory event log.

Important: If event logging is enabled, make sure to clear the event log after each HTTP method call. Otherwise the log will continue to grow without bounds.

The default value of this property is false.

The following items may be found in the event log:

NameValue
SocketConnecthostname:port, called when initiating a connection.
SocketConnectedhostname:port, called after successfully connected.
HttpProxyConnecthostname:port
SslHandshake "Starting"/"Finished"
HttpGetBeginURL
HttpCacheHit"Returning page from cache."
HttpInfovarious conditions...
"Begin reading response" -- called when beginning to read the response.
"Finished reading response"
"Existing connection with HTTP server no longer open, restarting GET with new connection."
"Reading chunked response."
"UnGzipping response data"
"Connection:close header is present"
GetRequestthe full HTTP GET request to be sent to the server.
ResponseHeaderthe header of the HTTP response.
HttpStatusCodeHTTP response status code (integer)
ChunkSizeSize (in bytes) of next chunk in response.
ResponseContentLengthNon-chunked response size in bytes.
UnGzippedLengthIf the response was gzip compressed, this is the uncompressed size.
HostnameResolvehostname, Called when starting to resolve a hostname (to an IP address)
ResolvedToIpdotted IP address, called after hostname is resolved.
HttpAuthone of the following strings:
"Starting Negotiate Authentication"
"Starting NTLM Authentication"
"Adding Basic Authentication Header"
"Adding Proxy Authentication Header"
"Starting Proxy NTLM Authentication"
"Starting Digest Authentication"
CookieToSendValue of a Set-Cookie header field to be added to the outgoing request.
SavingCookie XML of cookie being persisted.
HttpRedirectRedirect URL
Socks4Connectdomain:port
Socks5Connectdomain:port
HttpRequestBeginVerb (such as POST, GET, PUT), domain:port/path
RequestHeaderThe full HTTP request header to be sent.
StartSendingRequestSize of entire request, including header, in number of bytes. (Not called for QuickGet) For uploads, this is the size of the entire upload (headers and all files combined)
SubPartHeaderThe header for one of the parts within a multipart request.
UploadFilenameThe file about to be uploaded (streamed from file to socket..)

long get_LMFactor(void);
void put_LMFactor(long v);

An integer between 1 and 100 that indicates the percentage of time from the HTTP page's last-modified date that will be used for the freshness period. The default value is 25. For example, if a page is fetched with a last-modified date of 4 weeks ago, and the LMFactor = 25, then the page will be considered fresh in the cache for 1 week (25% of 4 weeks).

void get_LastContentType(CkString &strContentType);

The content-type of the last HTTP response received by the HTTP component.

void LastErrorHtml(CkString &str);

Error information in HTML format for the last method called.

void LastErrorText(CkString &str);

Error information in plain-text format for the last method called.

void LastErrorXml(CkString &str);

Error information in XML format for the last method called.

void get_LastHeader(CkString &str);

The text of the last HTTP header sent by any of this class's methods. The purpose of this property is to allow the developer to examine the exact HTTP header for debugging purposes.

void get_LastModDate(CkString &str);

The value of the Last-Modified header in the last HTTP response received by the HTTP component.

void get_LastResponseHeader(CkString &strHeader);

The entire last response header for the last HTTP response received by the HTTP component.

long get_LastStatus(void);

The last HTTP status value received by the HTTP component. This only applies to methods that do not return an HTTP response object. For methods that return an HTTP response object, such as SynchronousRequest, the status code is found in the StatusCode property of the response object.

void get_Login(CkString &str);
void put_Login(const char *v);

The HTTP login for pages requiring a login/password. Chilkat HTTP can do both Basic and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use NTLM, set the NtlmAuth property = true.

HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)

void get_LoginDomain(CkString &str);
void put_LoginDomain(const char *newVal);

The optional domain name to be used with NTLM / Kerberos / Negotiate authentication.

long get_MaxConnections(void);
void put_MaxConnections(long n);

The maximum number of simultaneous open HTTP connections managed by the HTTP component. The Chilkat HTTP component automatically manages HTTP connections. If the number of open HTTP connections is about to be exceeded, the connection with the least recent activity is automatically closed.

long get_MaxFreshPeriod(void);
void put_MaxFreshPeriod(long numMinutes);

Limits the amount of time a document can be kept "fresh" in the cache. The MaxFreshPeriod is specified in minutes, and the default value is 525600 which is equal to 1 year.

unsigned long get_MaxResponseSize(void);
void put_MaxResponseSize(unsigned long n);

The maximum HTTP response size to be accepted by the calling program. A value of 0 (the default) indicates that there is no maximum value.

long get_MaxUrlLen(void);
void put_MaxUrlLen(long n);

The Http class will automatically fail any URL longer than this length. The default MaxUrlLen is 800 characters.

bool get_MimicFireFox(void);
void put_MimicFireFox(bool b);

If set to true, then the appropriate headers to mimic Mozilla/FireFox are automatically added to requests sent via the QuickGet and QuickGetStr methods.

bool get_MimicIE(void);
void put_MimicIE(bool b);

If set to true, then the appropriate headers to mimic Internet Explorer are automatically added to requests sent via the QuickGet and QuickGetStr methods.

long get_MinFreshPeriod(void);
void put_MinFreshPeriod(long numMinutes);

The freshness period for a document in cache will not be less than this value (in minutes). The default value is 30.

bool get_NegotiateAuth(void);
void put_NegotiateAuth(bool newVal);

Set this property equal to true for Negotiate authentication. Negotiate authentication will dynamically select Kerberos or NTLM authentication depending on what the server requires.

Note: The NegotiateAuth property is only available for the Microsoft Windows operating system.

HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)

bool get_NtlmAuth(void);
void put_NtlmAuth(bool b);

Setting this property to true causes the HTTP component to use NTLM authentication (also known as IWA -- or Integrated Windows Authentication) when authentication with an HTTP server. The default value is false.

HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)

long get_NumCacheLevels(void);
void put_NumCacheLevels(long v);

The number of directory levels to be used under each cache root. The default is 0, meaning that each cached HTML page is stored in a cache root directory. A value of 1 causes each cached page to be stored in one of 255 subdirectories named "0","1", "2", ..."255" under a cache root. A value of 2 causes two levels of subdirectories ("0..255/0..255") under each cache root. The HTTP control automatically creates subdirectories as needed. The reason for mutliple levels is to alleviate problems that may arise with unrelated software when huge numbers of files are stored in a single directory. For example, Windows Explorer does not behave well when trying to display the contents of directories with thousands of files.

long get_NumCacheRoots(void);

The number of cache roots to be used for the HTTP cache. This allows the disk cache spread out over multiple disk drives. Each cache root is a string indicating the drive letter and directory path. For example, "E:\Cache". An example of a very large low-cost cache might be four USB external drives. To create a cache with four roots, call AddCacheRoot once for each directory root.

void get_Password(CkString &str);
void put_Password(const char *v);

The HTTP password for pages requiring a login/password. Chilkat HTTP can do both Basic and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use NTLM, set the NtlmAuth property = true.

void get_ProxyAuthMethod(CkString &str);
void put_ProxyAuthMethod(const char *newVal);

Set this to "basic" if you know in advance that Basic authentication is to be used for the HTTP proxy. Otherwise leave this property unset. Note: It is not necessary to set this property. The HTTP component will automatically handle proxy authentication for any of the supported authentication methods: NTLM, Digest, or Basic. Setting this property equal to "basic" prevents the 407 response which is automatically handled internal to Chilkat and never seen by your application.

void get_ProxyDomain(CkString &str);
void put_ProxyDomain(const char *v);

The domain name of a proxy host if an HTTP proxy is used.

void get_ProxyLogin(CkString &str);
void put_ProxyLogin(const char *newVal);

If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy login.

bool get_ProxyPartialUrl(void);
void put_ProxyPartialUrl(bool newVal);

The default value is false. If false, then the full URL is passed on the start line for HTTP requests (GET, POST, PUT, etc.) using a proxy. If true, then only the path is passed on the start line.

void get_ProxyPassword(CkString &str);
void put_ProxyPassword(const char *newVal);

If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy password.

long get_ProxyPort(void);
void put_ProxyPort(long n);

The port number of a proxy server if an HTTP proxy is used.

long get_ReadTimeout(void);
void put_ReadTimeout(long numSeconds);

The amount of time in seconds to wait before timing out when reading from an HTTP server. The ReadTimeout is the amount of time that needs to elapse while no additional data is forthcoming. During a long download, if the data stream halts for more than this amount, it will timeout. Otherwise, there is no limit on the length of time for the entire download.

void get_RedirectVerb(CkString &str);
void put_RedirectVerb(const char *newVal);

Indicates the HTTP verb, such as GET, POST, PUT, etc. to be used for a redirect when the FollowRedirects property is set to true. The default value is an empty string, indicating that the same verb as the original HTTP request should be used.

void get_Referer(CkString &str);
void put_Referer(const char *v);

The Referer header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is the empty string which causes the Referer field to be omitted from the request header.

void get_RequiredContentType(CkString &str);
void put_RequiredContentType(const char *newVal);

If set, then any HTTP response to any POST or GET, including downloads, will be rejected if the content-type in the response header does not match this setting. If the content-type does not match, only the header of the HTTP response is read, the connection to the HTTP server is closed, and the remainder of the response is never read.

This property is empty (zero-length string) by default.

Some typical content-types are "text/html", "text/xml", "image/gif", "image/jpeg", "application/zip", "application/msword", "application/pdf", etc.

bool get_SaveCookies(void);
void put_SaveCookies(bool b);

If this property is true, cookies are automatically persisted to XML files in the directory specified by the CookiesDir property (or in memory if CookieDir = "memory"). Both CookiesDir and SaveCookies must be set for cookies to be persisted.

Saving Cookies to XML Files

Caching cookies in-memory.

int get_SendBufferSize(void);
void put_SendBufferSize(int newVal);

The buffer size to be used with the underlying TCP/IP socket for sending. The default value is 65535.

bool get_SendCookies(void);
void put_SendCookies(bool b);

If true, then cookies previously persisted to the CookiesDir are automatically added to all HTTP requests. Only cookies matching the domain and path are added.

Caching cookies in-memory.

void get_SessionLogFilename(CkString &str);
void put_SessionLogFilename(const char *newVal);

Enables file-based session logging. If set to a filename (or relative/absolute filepath), then the exact HTTP requests and responses are logged to a file. The file is created if it does not already exist, otherwise it is appended.

Debugging HTTP

HTTP Session Logging

void get_SocksHostname(CkString &str);
void put_SocksHostname(const char *newVal);

The SOCKS4/SOCKS5 hostname or IPv4 address (in dotted decimal notation). This property is only used if the SocksVersion property is set to 4 or 5).

void get_SocksPassword(CkString &str);
void put_SocksPassword(const char *newVal);

The SOCKS5 password (if required). The SOCKS4 protocol does not include the use of a password, so this does not apply to SOCKS4.

int get_SocksPort(void);
void put_SocksPort(int newVal);

The SOCKS4/SOCKS5 proxy port. The default value is 1080. This property only applies if a SOCKS proxy is used (if the SocksVersion property is set to 4 or 5).

void get_SocksUsername(CkString &str);
void put_SocksUsername(const char *newVal);

The SOCKS4/SOCKS5 proxy username. This property is only used if the SocksVersion property is set to 4 or 5).

int get_SocksVersion(void);
void put_SocksVersion(int newVal);

SocksVersion May be set to one of the following integer values:

0 - No SOCKS proxy is used. This is the default.
4 - Connect via a SOCKS4 proxy.
5 - Connect via a SOCKS5 proxy.

void get_SslProtocol(CkString &str);
void put_SslProtocol(const char *newVal);

Selects the secure protocol to be used for secure (SSL) connections. Possible values are:

default
TLS 1.0
SSL 3.0
SSL 2.0
PCT 1.0
The default value is "default", which allows for the protocol to be selected dynamically at runtime based on the requirements of the server.

bool get_UpdateCache(void);
void put_UpdateCache(bool b);

Controls whether the cache is automatically updated with the responses from HTTP GET requests.

bool get_UseBgThread(void);
void put_UseBgThread(bool newVal);

If true, then background-enabled methods will run in a background thread. Normally, a method will return after its work is completed. However, when UseBgThread is true, the method will return immediately and a background thread is started to carry out the method’s task.

Background-enabled HTTP methods are:

bool get_UseIEProxy(void);
void put_UseIEProxy(bool b);

If true, the proxy host/port used by Internet Explorer will also be used by Chilkat HTTP.

void get_UserAgent(CkString &str);
void put_UserAgent(const char *v);

The UserAgent header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "Chilkat/1.0.0 (+http://www.chilkatsoft.com/ChilkatHttpUA.asp)" which indicates that the software used to issue the HTTP request was the Chilkat HTTP component.

bool get_Utf8(void) const;
void put_Utf8(bool b);

When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.

bool get_VerboseLogging(void);
void put_VerboseLogging(bool newVal);

If true, increases the amount of information available in LastErrorText (or LastErrorXml / LastErrorHtml). The default is false.

void get_Version(CkString &str);

Returns a string such as "1.0.0" indicating the version of the HTTP component.

bool get_WasRedirected(void);

Indicates whether the last HTTP GET was redirected.

Methods

void AddCacheRoot(const char * dir);

This method must be called at least once if disk caching is to be used. The file path (including drive letter) such as "E:\MyHttpCache\" is passed to AddCacheRoot to specify the root directory. The cache can be spread across multiple disk drives by calling AddCacheRoot multiple times, each with a directory path on a separate disk drive.

bool AddQuickHeader(const char * headerFieldName, const char * headerFieldValue);

Adds a custom header field to any HTTP request sent by a method that does not use the HTTP request object. These methods include Download, DownloadAppend, GetHead, PostBinary, PostMime, PostXml, PutBinary, PutText, QuickDeleteStr, QuickGet, QuickGetObj, QuickGetStr, QuickPutStr, XmlRpc, and XmlRpcPut.

Cookies may be explictly added by calling this method passing "Cookie" for the headerFieldName.

The RemoveQuickHeader method can be called to remove a custom header.

Adding Cookies to an HTTP Request

CkHttpResponse * BgResponseObject();

If a backgrounded method returns an Http response object, it may be retrieved by calling this method.

void BgTaskAbort();

Call this to force the currently running backgrounded method to abort.

void ClearBgEventLog();

Clears the in-memory event log (which is enabled by setting the KeepEventLog property = true).

void ClearInMemoryCookies();

Clears all cookies cached in memory. Calling this only makes sense if the CookieDir property is set to the string "memory".

bool CloseAllConnections();

Closes all connections still open from previous HTTP requests.

An HTTP object instance will maintain up to 10 connections. If the HTTP server's response does not include a "Connection: Close" header, the connection will remain open and will be re-used if possible for the next HTTP request to the same hostname:port. (It uses the IP address (in string form) or the domain name, whichever is used in the URL provided by the application.) If 10 connections are already open and another is needed, the object will close the least recently used connection.

bool Download(const char * url, const char * filename);

HTTP downloads a file at a URL. The file can be any size and any type. Large files are downloaded in streaming mode such that the memory footprint is small and steady. HTTPS is fully supported, as it is with all the methods of this class.

Returns true for success, false for failure.

HTTP Download any Type of File (binary or text)

Debugging HTTP

bool DownloadAppend(const char * url, const char * filename);

Same as the Download method, but the output file is open for append.

Returns true for success, false for failure.

bool DownloadHash(const char * url, const char * hashAlgorithm, const char * encoding, CkString & outStr);

To be documented soon...

bool EventLogName(int index, CkString & outStr);

Returns the name of the Nth event in the in-memory event log. Refer to the documentation for the KeepEventLog property for the full list of event names. Indexing is from 0 to EventLogCount-1.

Returns true for success, false for failure.

bool EventLogValue(int index, CkString & outStr);

Returns the value of the Nth event in the in-memory event log. Indexing is from 0 to EventLogCount-1.

Returns true for success, false for failure.

bool ExtractMetaRefreshUrl(const char * html, CkString & outStr);

To be documented soon...

bool GenTimeStamp(CkString & outStr);

Returns the current GMT (also known as UTC) date/time in a string that is compliant with RFC 2616 format.

Returns true for success, false for failure.

bool GetCacheRoot(int index, CkString & outStr);

Returns the Nth cache root (indexing begins at 0). Cache roots are set by calling AddCacheRoot one or more times.

Returns true for success, false for failure.

bool GetCookieXml(const char * domain, CkString & outStr);

Returns the cookies in XML format for a specific domain. Cookies are only persisted if the SaveCookies property is set to true. If the CookieDir property is set to the keyword "memory", then cookies are saved in-memory.

Returns true for success, false for failure.

bool GetDomain(const char * url, CkString & outStr);

Utility method for extracting the domain name from a full URL. For example, if "http://www.chilkatsoft.com/default.asp" is the URL passed in, then "www.chilkatsoft.com" is returned.

Returns true for success, false for failure.

CkHttpResponse * GetHead(const char * url);

Sends an HTTP HEAD request for a URL and returns a response object.

bool GetRequestHeader(const char * name, CkString & outStr);

Returns the value of a header field that has been pre-defined to be sent with all HTTP GET requests issued by the QuickGet and QuickGetStr methods. By default, this includes header fields such as Accept, AcceptCharset, AcceptLanguage, Connection, UserAgent, etc.

Returns true for success, false for failure.

CkCert * GetServerSslCert(const char * domain, int port);

Establishes an SSL/TLS connection with a web server for the purpose of retrieving the server's SSL certificate (public-key only of course...). Nothing is retrieved from the web server. This method simply makes a connection, gets the certificate information, and closes the connection.

bool GetUrlPath(const char * url, CkString & outStr);

Returns the path part of a URL. The syntax of a URL is ://:@:/;?#. This method returns the "path" part.

Returns true for success, false for failure.

bool HasRequestHeader(const char * name);

Returns true if the specified header field is defined such that it will be sent with all GET requests issued by the QuickGet and QuickGetStr methods.

bool IsUnlocked();

Returns true if the Http class has been unlocked. It is necessary to call Http.UnlockComponent before calling any other methods. Passing any string to UnlockComponent will automatically activate a 30-day trial period.

bool PostBinary(const char * url, CkByteData & byteData, const char * contentType, bool md5, bool gzip, CkString & outStr);

To be documented soon...

CkHttpResponse * PostJson(const char * url, const char * jsonText);

A simplified way of sending a JSON POST and receiving the JSON response. The HTTP response is returned in an HTTP response object.

HTTP POST JSON

CkHttpResponse * PostMime(const char * url, const char * mime);

Allows the calling application to specify the exact content to be sent in a POST. The HTTP POST is sent and the response is returned as an HTTP response object.

Debugging HTTP

CkHttpResponse * PostUrlEncoded(const char * url, CkHttpRequest & req);

Sends a simple URL encoded POST. The form parameters are sent in the body of the HTTP request in x-www-form-urlencoded format. The content-type is "application/x-www-form-urlencoded".

Duplicating a Simple HTML Form Submission (POST)

HTTP POST x-www-form-urlencoded

Debugging HTTP

CkHttpResponse * PostXml(const char * endpointUrl, const char * xmlContent, const char * xmlCharset);

A simplified way of posting XML content to a web server. This method is good for making SOAP calls using HTTP POST. The xmlCharset should match the character encoding used in the xmlContent, which is typically "utf-8". The HTTP response is returned in an HTTP response object.

Send XMLHttpRequest and Get Response

Calling a SOAP Web Service using PostXml

Debugging HTTP

bool PutBinary(const char * url, CkByteData & byteData, const char * contentType, bool md5, bool gzip, CkString & outStr);

Sends an HTTP PUT request to the url. The body of the HTTP request is byteData. The contentType is a content type such as "image/gif", "application/pdf", etc. If md5 is true, then a Content-MD5 header is added with the base64 MD5 hash of the byteData. Servers aware of the Content-MD5 header will perform a message integrity check to ensure that the data has not been corrupted. If gzip is true, the byteData is compressed using the gzip algorithm. The HTTP request body will contain the GZIP compressed data, and a "Content-Encoding: gzip" header is automatically added to indicate that the request data needs to be ungzipped when received (at the server).

Returns true for success, false for failure.

bool PutText(const char * url, const char * textData, const char * charset, const char * contentType, bool md5, bool gzip, CkString & outStr);

Sends an HTTP PUT request to the url. The body of the HTTP request is textData. The charset should be set to a charset name such as "iso-8859-1", "windows-1252", "Shift_JIS", "utf-8", etc. The string "ansi" may also be used as a charset name. The contentType is a content type such as "text/plain", "text/xml", etc. If md5 is true, then a Content-MD5 header is added with the base64 MD5 hash of the textData. Servers aware of the Content-MD5 header will perform a message integrity check to ensure that the data has not been corrupted. If gzip is true, the textData is compressed using the gzip algorithm. The HTTP request body will contain the GZIP compressed data, and a "Content-Encoding: gzip" header is automatically added to indicate that the request data needs to be ungzipped when received (at the server).

Returns true for success, false for failure.

bool QuickDeleteStr(const char * url, CkString & outStr);

Same as QuickGetStr, but uses the HTTP DELETE method instead of the GET method.

Returns true for success, false for failure.

Debugging HTTP

bool QuickGet(const char * url, CkByteData & outData);

Sends an HTTP GET request for a URL and returns the response body as a byte array. The URL may contain query parameters. If the SendCookies property is true, matching cookies previously persisted to the CookiesDir are automatically included in the request. If the FetchFromCache property is true, the page may be fetched directly from cache. Because the URL can specify any type of resource (HTML page, GIF image, etc.) the return value is a byte array. If the resource is known to be a string, such as with an HTML page, you may call QuickGetStr instead. If the HTTP request fails, a zero-length byte array is returned and error information can be found in the LastErrorText, LastErrorXml, or LastErrorHtml properties.

CkHttpResponse * QuickGetObj(const char * url);

To be documented soon.

bool QuickGetStr(const char * url, CkString & outStr);

Sends an HTTP GET request for a URL and returns the response body as a string. The URL may contain query parameters. If the SendCookies property is true, matching cookies previously persisted to the CookiesDir are automatically included in the request. If the FetchFromCache property is true, the page could be fetched directly from cache. If the HTTP request fails, a NULL value is returned and error information can be found in the LastErrorText, LastErrorXml, or LastErrorHtml properties.

Returns true for success, false for failure.

HTTP GET - Download HTML or any Text Content to a String

HTTPS GET using SSL/TLS

bool QuickPutStr(const char * url, CkString & outStr);

Same as QuickGetStr, but uses the HTTP PUT method instead of the GET method.

Returns true for success, false for failure.

Debugging HTTP

bool RemoveQuickHeader(const char * headerFieldName);

Removes a header from the internal list of custom header field name/value pairs to be automatically added when HTTP requests are sent via methods that do not use the HTTP request object. (The AddQuickHeader method is called to add custom header fields.)

void RemoveRequestHeader(const char * name);

Eliminates a header field from being included in HTTP GET requests issued by the QuickGet and QuickGetStr methods.

bool RenderGet(const char * url, CkString & outStr);

Same as QuickGet, but does not send the HTTP GET. Instead, it builds the HTTP request that would've been sent and returns it.

Returns true for success, false for failure.

bool ResumeDownload(const char * url, const char * targetFilename);

Same as the Download method, except a failed download may be resumed. The targetFilename is automatically checked and if it exists, the download will resume at the point where it previously failed. ResumeDownload may be called any number of times until the full download is complete.

Returns true for success, false for failure.

bool S3_CreateBucket(const char * bucketPath);

Creates a new Amazon S3 bucket.

Returns true for success, false for failure.

S3 Create Bucket Example

bool S3_DeleteBucket(const char * bucketPath);

Deletes an Amazon S3 bucket.

S3 Delete Bucket

bool S3_DeleteObject(const char * bucketPath, const char * objectName);

Deletes a remote file (object) on the Amazon S3 service.

Returns true for success, false for failure.

S3 Delete File

bool S3_DownloadBytes(const char * bucketPath, const char * objectName, CkByteData & outBytes);

The same as DownloadFile, except the file data is returned directly in-memory instead of being written to a local file.

bool S3_DownloadFile(const char * bucketPath, const char * objectName, const char * localFilePath);

Downloads a file from the Amazon S3 service.

Returns true for success, false for failure.

S3 Download File Example

bool S3_DownloadString(const char * bucketPath, const char * objectName, const char * charset, CkString & outStr);

Downloads a text file (object) from the Amazon S3 service directly into a string variable. The charset specifies the character encoding, such as "utf-8", of the remote text object.

Returns true for success, false for failure.

S3 Download String Object

bool S3_ListBucketObjects(const char * bucketPath, CkString & outStr);

Retrieves the XML listing of the objects contained within an Amazon S3 bucket. (This is like a directory listing, but in XML format.)

Returns true for success, false for failure.

S3 List Objects in Bucket

bool S3_ListBuckets(CkString & outStr);

Retrieves the XML listing of the buckets for an Amazon S3 account.

Returns true for success, false for failure.

S3 List Buckets Example

bool S3_UploadBytes(CkByteData & contentBytes, const char * contentType, const char * bucketPath, const char * objectName);

The same as S3_UploadFile, except the contents of the file come from contentBytes instead of a local file.

Returns true for success, false for failure.

bool S3_UploadFile(const char * localFilePath, const char * contentType, const char * bucketPath, const char * objectName);

Uploads a file to the Amazon S3 service.

Returns true for success, false for failure.

S3 Upload File

bool S3_UploadString(const char * objectContent, const char * charset, const char * contentType, const char * bucketPath, const char * objectName);

Uploads an in-memory string to the Amazon S3 service. This is the same as UploadFile, except that the file contents are from an in-memory string instead of a local file. Internal to this method, the objectContent is converted to the character encoding specified by charset prior to uploading.

Returns true for success, false for failure.

S3 Upload String

bool SaveLastError(const char * filename);

Saves the last error information to an XML formatted file.

bool SetCookieXml(const char * domain, const char * cookieXml);

Restores cookies for a particular domain. It is assumed that the cookie XML was previously retrieved via the GetCookieXml method, and saved to some sort of persistent storage, such as within a database table. It is then possible for an application to restore the cookies by calling this method.

Returns true for success, false for failure.

void SetRequestHeader(const char * name, const char * value);

Adds or replaces a custom HTTP request header to be sent with all GET requests issued by the QuickGet and QuickGetStr methods.

bool SetSslClientCert(CkCert & cert);

Allows for a client-side certificate to be used for an SSL connection.

bool SetSslClientCertPem(const char * pemDataOrFilename, const char * pemPassword);

To be documented soon...

bool SetSslClientCertPfx(const char * pfxFilename, const char * pfxPassword, const char * certSubjectCN);

To be documented soon...

void SleepMs(int millisec);

To be documented soon...

CkHttpResponse * SynchronousRequest(const char * domain, long port, bool ssl, const CkHttpRequest & req);

Sends an explicit HttpRequest to an HTTP server and returns an HttpResponse object. The HttpResponse object provides full access to the response including all headers and the response body. This method may be used to send POST requests, as well as GET, HEAD, file uploads, and XMLHTTP.

Simple HTTP POST

Debugging HTTP

Send XMLHttpRequest using PUT, GET, DELETE, or any HTTP Request Method

Adding Cookies to an HTTP Request

bool UnlockComponent(const char * unlockCode);

Unlocks the Http class/component. It is necessary to call Http.UnlockComponent before calling any other methods. Passing any string to UnlockComponent will automatically activate a 30-day trial period.

Returns true for success, false for failure.

bool UrlDecode(const char * str, CkString & outStr);

URL decodes a string.

Returns true for success, false for failure.

bool UrlEncode(const char * str, CkString & outStr);

URL encodes a string.

Returns true for success, false for failure.

bool XmlRpc(const char * urlEndpoint, const char * xmlIn, CkString & outStr);

Makes an XML RPC call to a URL endpoint. The XML string is passed in an HTTP POST, and the XML response is returned.

Returns true for success, false for failure.

bool XmlRpcPut(const char * urlEndpoint, const char * xmlIn, CkString & outStr);

Same as XmlRpc, but uses the HTTP PUT method instead of the POST method.

Returns true for success, false for failure.

const char * acceptCharset();

The AcceptCharset header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "ISO-8859-1,utf-8;q=0.7,*;q=0.7".

Returns a null on failure

const char * acceptLanguage();

The AcceptLanguage header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "en-us,en;q=0.5".

Returns a null on failure

const char * awsAccessKey();

To be documented soon...

const char * awsSecretKey();

To be documented soon...

const char * bgLastErrorText();

When a background-enabled method is run asynchronously in a background thread, the last-error information is saved here and not in the LastErrorText property. If the background method fails, this will contain information about what transpired. (This property also contains information when the background method succeeds.)

Returns a null on failure

More information on background enabling HTTP communications.

Example for background thread HTTP Download.

const char * bgResultString();

If a backgrounded method returns a string, the return value is found here.

Returns a null on failure

const char * ck_accept();

To be documented soon...

const char * clientIpAddress();

The IP address to use for computers with multiple network interfaces or IP addresses. For computers with a single network interface (i.e. most computers), this property should not be set. For multihoming computers, the default IP address is automatically used if this property is not set.

The IP address is a string such as in dotted notation using numbers, not domain names, such as "165.164.55.124".

Returns a null on failure

Important Bind to Adapter Notes for Windows

const char * connection();

The Connection header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "Keep-Alive". To prevent the Connection header from being added to the HTTP header, set this property to the empty string.

Returns a null on failure

const char * cookieDir();

Specifies a directory where cookies are automatically persisted if the Http.SaveCookies property is turned on. Cookies are stored in XML formatted files, one per domain, to main it easy for other programs to understand and parse. May be set to the string "memory" to cache cookies in memory.

Returns a null on failure

Saving Cookies to XML Files

Caching cookies in-memory.

const char * debugLogFilePath();

Used for debugging in cases where a Chilkat method call hangs and never returns. This should generally never happen. The only causes for this are (1) a timeout related property was set to 0 to explicitly indicate that an infinite timeout is desired, (2) the hang is actually a hang within an event callback (i.e. it is a hang within the application code), or (3) there is an internal problem (bug) in the Chilkat code that causes the hang.

This property allows one to specifiy a debug file path that will be created (or appended if it already exists) and information will be logged to it as the Chilkat methods are called. If a hang occurs, the log file may be viewed to get information about what happened.

Returns a null on failure

const char * downloadHash(const char * url, const char * hashAlgorithm, const char * encoding);

To be documented soon...

const char * eventLogName(int index);

Returns the name of the Nth event in the in-memory event log. Refer to the documentation for the KeepEventLog property for the full list of event names. Indexing is from 0 to EventLogCount-1.

Returns a null on failure

const char * eventLogValue(int index);

Returns the value of the Nth event in the in-memory event log. Indexing is from 0 to EventLogCount-1.

Returns a null on failure

const char * extractMetaRefreshUrl(const char * html);

To be documented soon...

const char * finalRedirectUrl();

If an HTTP GET was redirected (as indicated by the WasRedirected property), this property will contain the final redirect URL, assuming the FollowRedirects property is true.

Returns a null on failure

Tracing HTTP Redirects

const char * genTimeStamp();

Returns the current GMT (also known as UTC) date/time in a string that is compliant with RFC 2616 format.

Returns a null on failure

const char * getCacheRoot(int index);

Returns the Nth cache root (indexing begins at 0). Cache roots are set by calling AddCacheRoot one or more times.

Returns a null on failure

const char * getCookieXml(const char * domain);

Returns the cookies in XML format for a specific domain. Cookies are only persisted if the SaveCookies property is set to true. If the CookieDir property is set to the keyword "memory", then cookies are saved in-memory.

Returns a null on failure

const char * getDomain(const char * url);

Utility method for extracting the domain name from a full URL. For example, if "http://www.chilkatsoft.com/default.asp" is the URL passed in, then "www.chilkatsoft.com" is returned.

Returns a null on failure

const char * getRequestHeader(const char * name);

Returns the value of a header field that has been pre-defined to be sent with all HTTP GET requests issued by the QuickGet and QuickGetStr methods. By default, this includes header fields such as Accept, AcceptCharset, AcceptLanguage, Connection, UserAgent, etc.

Returns a null on failure

const char * getUrlPath(const char * url);

Returns the path part of a URL. The syntax of a URL is ://:@:/;?#. This method returns the "path" part.

Returns a null on failure

const char * lastContentType();

The content-type of the last HTTP response received by the HTTP component.

Returns a null on failure

const char * lastErrorHtml();

Error information in HTML format for the last method called.

Returns a null on failure

const char * lastErrorText();

Error information in plain-text format for the last method called.

Returns a null on failure

const char * lastErrorXml();

Error information in XML format for the last method called.

Returns a null on failure

const char * lastHeader();

The text of the last HTTP header sent by any of this class's methods. The purpose of this property is to allow the developer to examine the exact HTTP header for debugging purposes.

Returns a null on failure

const char * lastModDate();

The value of the Last-Modified header in the last HTTP response received by the HTTP component.

Returns a null on failure

const char * lastResponseHeader();

The entire last response header for the last HTTP response received by the HTTP component.

Returns a null on failure

const char * login();

The HTTP login for pages requiring a login/password. Chilkat HTTP can do both Basic and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use NTLM, set the NtlmAuth property = true.

Returns a null on failure

HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)

const char * loginDomain();

The optional domain name to be used with NTLM / Kerberos / Negotiate authentication.

Returns a null on failure

const char * password();

The HTTP password for pages requiring a login/password. Chilkat HTTP can do both Basic and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use NTLM, set the NtlmAuth property = true.

Returns a null on failure

const char * postBinary(const char * url, CkByteData & byteData, const char * contentType, bool md5, bool gzip);

To be documented soon...

const char * proxyAuthMethod();

Set this to "basic" if you know in advance that Basic authentication is to be used for the HTTP proxy. Otherwise leave this property unset. Note: It is not necessary to set this property. The HTTP component will automatically handle proxy authentication for any of the supported authentication methods: NTLM, Digest, or Basic. Setting this property equal to "basic" prevents the 407 response which is automatically handled internal to Chilkat and never seen by your application.

Returns a null on failure

const char * proxyDomain();

The domain name of a proxy host if an HTTP proxy is used.

Returns a null on failure

const char * proxyLogin();

If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy login.

Returns a null on failure

const char * proxyPassword();

If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy password.

Returns a null on failure

const char * putBinary(const char * url, CkByteData & byteData, const char * contentType, bool md5, bool gzip);

Sends an HTTP PUT request to the url. The body of the HTTP request is byteData. The contentType is a content type such as "image/gif", "application/pdf", etc. If md5 is true, then a Content-MD5 header is added with the base64 MD5 hash of the byteData. Servers aware of the Content-MD5 header will perform a message integrity check to ensure that the data has not been corrupted. If gzip is true, the byteData is compressed using the gzip algorithm. The HTTP request body will contain the GZIP compressed data, and a "Content-Encoding: gzip" header is automatically added to indicate that the request data needs to be ungzipped when received (at the server).

Returns a null on failure

const char * putText(const char * url, const char * textData, const char * charset, const char * contentType, bool md5, bool gzip);

Sends an HTTP PUT request to the url. The body of the HTTP request is textData. The charset should be set to a charset name such as "iso-8859-1", "windows-1252", "Shift_JIS", "utf-8", etc. The string "ansi" may also be used as a charset name. The contentType is a content type such as "text/plain", "text/xml", etc. If md5 is true, then a Content-MD5 header is added with the base64 MD5 hash of the textData. Servers aware of the Content-MD5 header will perform a message integrity check to ensure that the data has not been corrupted. If gzip is true, the textData is compressed using the gzip algorithm. The HTTP request body will contain the GZIP compressed data, and a "Content-Encoding: gzip" header is automatically added to indicate that the request data needs to be ungzipped when received (at the server).

Returns a null on failure

const char * quickDeleteStr(const char * url);

Same as QuickGetStr, but uses the HTTP DELETE method instead of the GET method.

Returns a null on failure

Debugging HTTP

const char * quickGetStr(const char * url);

Sends an HTTP GET request for a URL and returns the response body as a string. The URL may contain query parameters. If the SendCookies property is true, matching cookies previously persisted to the CookiesDir are automatically included in the request. If the FetchFromCache property is true, the page could be fetched directly from cache. If the HTTP request fails, a NULL value is returned and error information can be found in the LastErrorText, LastErrorXml, or LastErrorHtml properties.

Returns a null on failure

HTTP GET - Download HTML or any Text Content to a String

HTTPS GET using SSL/TLS

const char * quickPutStr(const char * url);

Same as QuickGetStr, but uses the HTTP PUT method instead of the GET method.

Returns a null on failure

Debugging HTTP

const char * redirectVerb();

Indicates the HTTP verb, such as GET, POST, PUT, etc. to be used for a redirect when the FollowRedirects property is set to true. The default value is an empty string, indicating that the same verb as the original HTTP request should be used.

Returns a null on failure

const char * referer();

The Referer header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is the empty string which causes the Referer field to be omitted from the request header.

Returns a null on failure

const char * renderGet(const char * url);

Same as QuickGet, but does not send the HTTP GET. Instead, it builds the HTTP request that would've been sent and returns it.

Returns a null on failure

const char * requiredContentType();

If set, then any HTTP response to any POST or GET, including downloads, will be rejected if the content-type in the response header does not match this setting. If the content-type does not match, only the header of the HTTP response is read, the connection to the HTTP server is closed, and the remainder of the response is never read.

This property is empty (zero-length string) by default.

Some typical content-types are "text/html", "text/xml", "image/gif", "image/jpeg", "application/zip", "application/msword", "application/pdf", etc.

Returns a null on failure

const char * s3_DownloadString(const char * bucketPath, const char * objectName, const char * charset);

Downloads a text file (object) from the Amazon S3 service directly into a string variable. The charset specifies the character encoding, such as "utf-8", of the remote text object.

Returns a null on failure

S3 Download String Object

const char * s3_ListBucketObjects(const char * bucketPath);

Retrieves the XML listing of the objects contained within an Amazon S3 bucket. (This is like a directory listing, but in XML format.)

Returns a null on failure

S3 List Objects in Bucket

const char * s3_ListBuckets();

Retrieves the XML listing of the buckets for an Amazon S3 account.

Returns a null on failure

S3 List Buckets Example

const char * sessionLogFilename();

Enables file-based session logging. If set to a filename (or relative/absolute filepath), then the exact HTTP requests and responses are logged to a file. The file is created if it does not already exist, otherwise it is appended.

Returns a null on failure

Debugging HTTP

HTTP Session Logging

const char * socksHostname();

The SOCKS4/SOCKS5 hostname or IPv4 address (in dotted decimal notation). This property is only used if the SocksVersion property is set to 4 or 5).

Returns a null on failure

const char * socksPassword();

The SOCKS5 password (if required). The SOCKS4 protocol does not include the use of a password, so this does not apply to SOCKS4.

Returns a null on failure

const char * socksUsername();

The SOCKS4/SOCKS5 proxy username. This property is only used if the SocksVersion property is set to 4 or 5).

Returns a null on failure

const char * sslProtocol();

Selects the secure protocol to be used for secure (SSL) connections. Possible values are:

default
TLS 1.0
SSL 3.0
SSL 2.0
PCT 1.0
The default value is "default", which allows for the protocol to be selected dynamically at runtime based on the requirements of the server.

Returns a null on failure

const char * urlDecode(const char * str);

URL decodes a string.

Returns a null on failure

const char * urlEncode(const char * str);

URL encodes a string.

Returns a null on failure

const char * userAgent();

The UserAgent header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "Chilkat/1.0.0 (+http://www.chilkatsoft.com/ChilkatHttpUA.asp)" which indicates that the software used to issue the HTTP request was the Chilkat HTTP component.

Returns a null on failure

const char * version();

Returns a string such as "1.0.0" indicating the version of the HTTP component.

Returns a null on failure

const char * xmlRpc(const char * urlEndpoint, const char * xmlIn);

Makes an XML RPC call to a URL endpoint. The XML string is passed in an HTTP POST, and the XML response is returned.

Returns a null on failure

const char * xmlRpcPut(const char * urlEndpoint, const char * xmlIn);

Same as XmlRpc, but uses the HTTP PUT method instead of the POST method.

Returns a null on failure