Http Delphi DLL Reference Documentation

Http

Current Version: 9.5.0.73

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.

Create/Dispose

var
myObject: HCkHttp;

begin
myObject := CkHttp_Create();

// ...

CkHttp_Dispose(myObject);
end;
function CkHttp_Create: HCkHttp; stdcall;

Creates an instance of the HCkHttp object and returns a handle (i.e. a Pointer). The handle is passed in the 1st argument for the functions listed on this page.

procedure CkHttp_Dispose(handle: HCkHttp); stdcall;

Objects created by calling CkHttp_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function.

Properties

AbortCurrent
function CkHttp_getAbortCurrent(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putAbortCurrent(objHandle: HCkHttp; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.58

When set to True, causes the currently running method to abort. Methods that always finish quickly (i.e.have no length file operations or network communications) are not affected. If no method is running, then this property is automatically reset to False when the next method is called. When the abort occurs, this property is reset to False. Both synchronous and asynchronous method calls can be aborted. (A synchronous method call could be aborted by setting this property from a separate thread.)

top
Accept
procedure CkHttp_getAccept(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAccept(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__accept(objHandle: HCkHttp): PWideChar; stdcall;

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

top
AcceptCharset
procedure CkHttp_getAcceptCharset(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAcceptCharset(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__acceptCharset(objHandle: HCkHttp): PWideChar; stdcall;

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".

top
AcceptLanguage
procedure CkHttp_getAcceptLanguage(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAcceptLanguage(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__acceptLanguage(objHandle: HCkHttp): PWideChar; stdcall;

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".

top
AllowGzip
function CkHttp_getAllowGzip(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putAllowGzip(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

top
AllowHeaderFolding
function CkHttp_getAllowHeaderFolding(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putAllowHeaderFolding(objHandle: HCkHttp; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.63

If this property is set to False, then no MIME header folding will be automatically applied to any request header. The default is True.

top
AuthToken
procedure CkHttp_getAuthToken(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAuthToken(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__authToken(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.67

If set, then automatically adds the "Authorization: Bearer " header to all requests. (If you have an OAuth2 access token, set this property equal to the OAuth2 access token string. Note: For OAuth1 (older) tokens, use the OAuthTOken property. )

top
AutoAddHostHeader
function CkHttp_getAutoAddHostHeader(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putAutoAddHostHeader(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

top
AwsAccessKey
procedure CkHttp_getAwsAccessKey(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAwsAccessKey(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__awsAccessKey(objHandle: HCkHttp): PWideChar; stdcall;

The AWS Access Key to be used with the Amazon S3 methods listed below.

top
AwsEndpoint
procedure CkHttp_getAwsEndpoint(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAwsEndpoint(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__awsEndpoint(objHandle: HCkHttp): PWideChar; stdcall;

The regional endpoint (domain) to be used for Amazon S3 method calls. The default value is "s3.amazonaws.com". This can be set to any valid Amazon S3 endpoint, such as "s3-eu-west-1.amazonaws.com", or the endpoints for S3-API compatible services from other different providers.

top
AwsRegion
procedure CkHttp_getAwsRegion(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAwsRegion(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__awsRegion(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.56

The AWS (S3) region, such as "us-east-1", "us-west-2", "eu-west-1", "eu-central-1", etc. This propery defaults to "us-east-1". It is only used when the AwsSignatureVersion property is set to 4. When the AwsSignatureVersion property is set to 2, then this property is unused.

top
AwsSecretKey
procedure CkHttp_getAwsSecretKey(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAwsSecretKey(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__awsSecretKey(objHandle: HCkHttp): PWideChar; stdcall;

The AWS Secret Key to be used with the Amazon S3 methods listed below.

top
AwsSignatureVersion
function CkHttp_getAwsSignatureVersion(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putAwsSignatureVersion(objHandle: HCkHttp; newPropVal: Integer); stdcall;
Introduced in version 9.5.0.56

Selects the AWS Signature Version algorithm. The default value is 2. May be set to 4 to select AWS Signature Version 4.

top
AwsSubResources
procedure CkHttp_getAwsSubResources(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putAwsSubResources(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__awsSubResources(objHandle: HCkHttp): PWideChar; stdcall;

The AWS sub-resources to be used with the Amazon S3 methods listed below.

If the S3 request needs to address a sub-resource, like ?versioning, ?policy, ?location, ?acl, or ?torrent, or ?versionid append the sub-resource and its value if it has one. Note that in case of multiple sub-resources, sub-resources must be lexicographically sorted by sub-resource name and separated by '&'. e.g. "acl&versionId=value"

The list of sub-resources that can be included are: acl, location, logging, notification, partNumber, policy, requestPayment, torrent, uploadId, uploads, versionId, versioning, versions and website.

top
BandwidthThrottleDown
function CkHttp_getBandwidthThrottleDown(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putBandwidthThrottleDown(objHandle: HCkHttp; newPropVal: Integer); stdcall;
Introduced in version 9.5.0.49

If non-zero, limits (throttles) the download bandwidth to approximately this maximum number of bytes per second. The default value of this property is 0.

top
BandwidthThrottleUp
function CkHttp_getBandwidthThrottleUp(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putBandwidthThrottleUp(objHandle: HCkHttp; newPropVal: Integer); stdcall;
Introduced in version 9.5.0.49

If non-zero, limits (throttles) the upload bandwidth to approximately this maximum number of bytes per second. The default value of this property is 0.

top
BasicAuth
function CkHttp_getBasicAuth(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putBasicAuth(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

If HTTP basic authentication is needed, this property must be set to True. The HTTP protocol allows for several different types of authentication schemes, such as NTLM, Digest, OAuth1, etc. A given server will support (or allow) certain authentication schemes (also known as authentication methods). Except for the "Basic" authentication method, the other forms of authentication do not involve sending the login and password in plain unencrypted text over the connection. The Basic authentication method is insecure in that it sends the login/password for all to see. If the connection is SSL/TLS, then this might be considered OK. Chilkat takes the safe approach and will not allow Basic authentication unless this property has been explicitly set to True. The default value of this property is False.

Note: It is not required to know the authentication methods accepted by the server beforehand (except for the case of Basic authentication). When authentication is required, Chilkat will first send the request without the Authorization header, receive back the 401 Authorization Required response along with information about what authentication methods are accepted, and then re-send with an accepted authentication method. If the authentication method is known in advance, then an application may set the appropriate property, such as NtlmAuth to True so that the extra (internal) round-trip is not required.

top
ClientIpAddress
procedure CkHttp_getClientIpAddress(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putClientIpAddress(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__clientIpAddress(objHandle: HCkHttp): PWideChar; stdcall;

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".

More Information and Examples
top
ConnectFailReason
function CkHttp_getConnectFailReason(objHandle: HCkHttp): Integer; stdcall;
Introduced in version 9.5.0.56

This property will be set to the status of the last HTTP connection made (or failed to be made) by any HTTP method.

Possible values are:

0 = success

Normal (non-TLS) sockets:
1 = empty hostname
2 = DNS lookup failed
3 = DNS timeout
4 = Aborted by application.
5 = Internal failure.
6 = Connect Timed Out
7 = Connect Rejected (or failed for some other reason)
50 = HTTP proxy authentication failure.
98 = Async operation in progress.
99 = Product is not unlocked.

SSL/TLS:
100 = TLS internal error.
101 = Failed to send client hello.
102 = Unexpected handshake message.
103 = Failed to read server hello.
104 = No server certificate.
105 = Unexpected TLS protocol version.
106 = Server certificate verify failed (the server certificate is expired or the cert's signature verification failed).
107 = Unacceptable TLS protocol version.
109 = Failed to read handshake messages.
110 = Failed to send client certificate handshake message.
111 = Failed to send client key exchange handshake message.
112 = Client certificate's private key not accessible.
113 = Failed to send client cert verify handshake message.
114 = Failed to send change cipher spec handshake message.
115 = Failed to send finished handshake message.
116 = Server's Finished message is invalid.

top
Connection
procedure CkHttp_getConnection(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putConnection(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__connection(objHandle: HCkHttp): PWideChar; stdcall;

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.

top
ConnectTimeout
function CkHttp_getConnectTimeout(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putConnectTimeout(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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

Note: This is the maximum number of seconds to wait for a server to accept a TCP connection. Once the connection is accepted, and bytes begin flowing back-and-forth, then it is the ReadTimeout property that applies. It is the ReadTimeout that applies when receiving data, which includes the reads that occur during a TLS handshake.

top
CookieDir
procedure CkHttp_getCookieDir(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putCookieDir(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__cookieDir(objHandle: HCkHttp): PWideChar; stdcall;

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.

top
DebugLogFilePath
procedure CkHttp_getDebugLogFilePath(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putDebugLogFilePath(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__debugLogFilePath(objHandle: HCkHttp): PWideChar; stdcall;

If set to a file path, causes each Chilkat method or property call to automatically append it's LastErrorText to the specified log file. The information is appended such that if a hang or crash occurs, it is possible to see the context in which the problem occurred, as well as a history of all Chilkat calls up to the point of the problem. The VerboseLogging property can be set to provide more detailed information.

This property is typically used for debugging the rare cases where a Chilkat method call hangs or generates an exception that halts program execution (i.e. crashes). A hang or crash should generally never happen. The typical causes of a hang 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.

top
DefaultFreshPeriod
function CkHttp_getDefaultFreshPeriod(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putDefaultFreshPeriod(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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

top
DigestAuth
function CkHttp_getDigestAuth(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putDigestAuth(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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

top
FetchFromCache
function CkHttp_getFetchFromCache(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putFetchFromCache(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

top
FinalRedirectUrl
procedure CkHttp_getFinalRedirectUrl(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__finalRedirectUrl(objHandle: HCkHttp): PWideChar; stdcall;

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.

Note: Starting in v9.5.0.49, this property will contain the redirect URL for 301/302 responses even if FollowRedirects is not set to True.

More Information and Examples
top
FollowRedirects
function CkHttp_getFollowRedirects(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putFollowRedirects(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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

top
FreshnessAlgorithm
function CkHttp_getFreshnessAlgorithm(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putFreshnessAlgorithm(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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.

top
IgnoreMustRevalidate
function CkHttp_getIgnoreMustRevalidate(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putIgnoreMustRevalidate(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

top
IgnoreNoCache
function CkHttp_getIgnoreNoCache(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putIgnoreNoCache(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

top
KeepResponseBody
function CkHttp_getKeepResponseBody(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putKeepResponseBody(objHandle: HCkHttp; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.55

If True, then the response body, if text, is saved to the LastResponseBody property for all methods that do not return an HttpResponse object. The default value of this property is False.

top
LastContentType
procedure CkHttp_getLastContentType(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastContentType(objHandle: HCkHttp): PWideChar; stdcall;

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

top
LastErrorHtml
procedure CkHttp_getLastErrorHtml(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastErrorHtml(objHandle: HCkHttp): PWideChar; stdcall;

Provides information in HTML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastErrorText
procedure CkHttp_getLastErrorText(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastErrorText(objHandle: HCkHttp): PWideChar; stdcall;

Provides information in plain-text format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastErrorXml
procedure CkHttp_getLastErrorXml(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastErrorXml(objHandle: HCkHttp): PWideChar; stdcall;

Provides information in XML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastHeader
procedure CkHttp_getLastHeader(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastHeader(objHandle: HCkHttp): PWideChar; stdcall;

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.

top
LastMethodSuccess
function CkHttp_getLastMethodSuccess(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putLastMethodSuccess(objHandle: HCkHttp; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.52

Indicate whether the last method call succeeded or failed. A value of True indicates success, a value of False indicates failure. This property is automatically set for method calls. It is not modified by property accesses. The property is automatically set to indicate success for the following types of method calls:

  • Any method that returns a string.
  • Any method returning a Chilkat object, binary bytes, or a date/time.
  • Any method returning a standard boolean status value where success = True and failure = False.
  • Any method returning an integer where failure is defined by a return value less than zero.

Note: Methods that do not fit the above requirements will always set this property equal to True. For example, a method that returns no value (such as a "void" in C++) will technically always succeed.

top
LastModDate
procedure CkHttp_getLastModDate(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastModDate(objHandle: HCkHttp): PWideChar; stdcall;

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

top
LastResponseBody
procedure CkHttp_getLastResponseBody(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastResponseBody(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.55

The response body of the last HTTP response received by the HTTP component (for methods that do not return an HttpResponse object). The last response body is only saved to this property IF the KeepResponseBody property is set to True.

top
LastResponseHeader
procedure CkHttp_getLastResponseHeader(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastResponseHeader(objHandle: HCkHttp): PWideChar; stdcall;

The entire response header for the last HTTP response received by the HTTP component (for methods that do not return an HttpResponse object).

top
LastStatus
function CkHttp_getLastStatus(objHandle: HCkHttp): Integer; stdcall;

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.

top
LastStatusText
procedure CkHttp_getLastStatusText(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__lastStatusText(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.69

The last HTTP status text 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 text is found in the StatusText property of the response object.

top
LMFactor
function CkHttp_getLMFactor(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putLMFactor(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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).

top
Login
procedure CkHttp_getLogin(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putLogin(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__login(objHandle: HCkHttp): PWideChar; stdcall;

The HTTP login for pages requiring a login/password. Chilkat HTTP can do Basic, Digest, and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use Basic authentication, the BasicAuth property must be set equal to True. It is not necessary to set the NtlmAuth or DigestAuth properties beforehand if NTLM or Digest authentication is needed. However, it is most efficient to pre-set these properties when the type of authentication is known in advance.

Important: If NTLM authentication is used, it may be incorrect to set the Login property equal to "mydomain\mylogin". Instead, set the LoginDomain property equal to "mydomain", and set this property equal to "mylogin".

top
LoginDomain
procedure CkHttp_getLoginDomain(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putLoginDomain(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__loginDomain(objHandle: HCkHttp): PWideChar; stdcall;

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

top
MaxConnections
function CkHttp_getMaxConnections(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putMaxConnections(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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.

top
MaxFreshPeriod
function CkHttp_getMaxFreshPeriod(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putMaxFreshPeriod(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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.

top
MaxResponseSize
function CkHttp_getMaxResponseSize(objHandle: HCkHttp): LongWord; stdcall;
procedure CkHttp_putMaxResponseSize(objHandle: HCkHttp; newPropVal: LongWord); stdcall;

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.

top
MaxUrlLen
function CkHttp_getMaxUrlLen(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putMaxUrlLen(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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

top
MimicFireFox
function CkHttp_getMimicFireFox(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putMimicFireFox(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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

top
MimicIE
function CkHttp_getMimicIE(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putMimicIE(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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

top
MinFreshPeriod
function CkHttp_getMinFreshPeriod(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putMinFreshPeriod(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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

top
NegotiateAuth
function CkHttp_getNegotiateAuth(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putNegotiateAuth(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

top
NtlmAuth
function CkHttp_getNtlmAuth(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putNtlmAuth(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

top
NumCacheLevels
function CkHttp_getNumCacheLevels(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putNumCacheLevels(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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.

top
NumCacheRoots
function CkHttp_getNumCacheRoots(objHandle: HCkHttp): Integer; stdcall;

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.

top
OAuth1
function CkHttp_getOAuth1(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putOAuth1(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

If True then causes an OAuth Authorization header to be added to any request sent by the HTTP object. For example:

Authorization: OAuth realm="http://sp.example.com/",
                oauth_consumer_key="0685bd9184jfhq22",
                oauth_token="ad180jjd733klru7",
                oauth_signature_method="HMAC-SHA1",
                oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D",
                oauth_timestamp="137131200",
                oauth_nonce="4572616e48616d6d65724c61686176",
                oauth_version="1.0"
The information used to compute the OAuth Authorization header is obtained from the other OAuth* properties, such as OAuthConsumerKey, OAuthConsumerSecret, OAuthRealm, etc.

top
OAuthCallback
procedure CkHttp_getOAuthCallback(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putOAuthCallback(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__oAuthCallback(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.53

The OAuth 1.0 callback URL. Defaults to "oob".

top
OAuthConsumerKey
procedure CkHttp_getOAuthConsumerKey(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putOAuthConsumerKey(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__oAuthConsumerKey(objHandle: HCkHttp): PWideChar; stdcall;

The OAuth consumer key to be used in the Authorization header.

top
OAuthConsumerSecret
procedure CkHttp_getOAuthConsumerSecret(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putOAuthConsumerSecret(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__oAuthConsumerSecret(objHandle: HCkHttp): PWideChar; stdcall;

The OAuth consumer secret to be used in computing the contents of the Authorization header.

top
OAuthRealm
procedure CkHttp_getOAuthRealm(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putOAuthRealm(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__oAuthRealm(objHandle: HCkHttp): PWideChar; stdcall;

The OAuth realm to be used in the Authorization header.

top
OAuthSigMethod
procedure CkHttp_getOAuthSigMethod(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putOAuthSigMethod(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__oAuthSigMethod(objHandle: HCkHttp): PWideChar; stdcall;

The OAuth signature method, such as "HMAC-SHA1" to be used in the Authorization header. The default is "HMAC-SHA1". It is also possible to choose "HMAC-SHA256", "RSA-SHA1" or "RSA-SHA2". For RSA algorithms, an RSA private key would need to be provided via the SetOAuthRsaKey method.

Note: RSA-SHA2 is supported starting in Chilkat v9.5.0.56

top
OAuthToken
procedure CkHttp_getOAuthToken(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putOAuthToken(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__oAuthToken(objHandle: HCkHttp): PWideChar; stdcall;

The OAuth1 token to be used in the Authorization header. Note: This is for OAuth1. It is not the way to add an OAuth2 access token to the request. To add an OAuth2 access token to the request, set the AuthToken property.

More Information and Examples
top
OAuthTokenSecret
procedure CkHttp_getOAuthTokenSecret(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putOAuthTokenSecret(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__oAuthTokenSecret(objHandle: HCkHttp): PWideChar; stdcall;

The OAuth token secret to be used in computing the Authorization header.

top
OAuthVerifier
procedure CkHttp_getOAuthVerifier(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putOAuthVerifier(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__oAuthVerifier(objHandle: HCkHttp): PWideChar; stdcall;

The OAuth verifier to be used in the Authorization header.

top
Password
procedure CkHttp_getPassword(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putPassword(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__password(objHandle: HCkHttp): PWideChar; stdcall;

The HTTP password for pages requiring a login/password. Chilkat HTTP can do Basic, Digest, and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use Basic authentication, the BasicAuth property must be set equal to True. It is not necessary to set the NtlmAuth or DigestAuth properties beforehand if NTLM or Digest authentication is needed. However, it is most efficient to pre-set these properties when the type of authentication is known in advance.

top
PreferIpv6
function CkHttp_getPreferIpv6(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putPreferIpv6(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

If True, then use IPv6 over IPv4 when both are supported for a particular domain. The default value of this property is False, which will choose IPv4 over IPv6.

top
ProxyAuthMethod
procedure CkHttp_getProxyAuthMethod(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putProxyAuthMethod(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__proxyAuthMethod(objHandle: HCkHttp): PWideChar; stdcall;

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.

Note: If NTLM authentication does not succeed, set the Global.DefaultNtlmVersion property equal to 1 and then retry.

top
ProxyDomain
procedure CkHttp_getProxyDomain(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putProxyDomain(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__proxyDomain(objHandle: HCkHttp): PWideChar; stdcall;

The domain name of a proxy host if an HTTP proxy is used. This can also be set to an IP address.

top
ProxyLogin
procedure CkHttp_getProxyLogin(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putProxyLogin(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__proxyLogin(objHandle: HCkHttp): PWideChar; stdcall;

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

top
ProxyLoginDomain
procedure CkHttp_getProxyLoginDomain(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putProxyLoginDomain(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__proxyLoginDomain(objHandle: HCkHttp): PWideChar; stdcall;

The NTLM authentication domain (optional) if NTLM authentication is used.

top
ProxyPassword
procedure CkHttp_getProxyPassword(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putProxyPassword(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__proxyPassword(objHandle: HCkHttp): PWideChar; stdcall;

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

top
ProxyPort
function CkHttp_getProxyPort(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putProxyPort(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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

top
ReadTimeout
function CkHttp_getReadTimeout(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putReadTimeout(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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.

The default value is 20 seconds.

top
RedirectVerb
procedure CkHttp_getRedirectVerb(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putRedirectVerb(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__redirectVerb(objHandle: HCkHttp): PWideChar; stdcall;

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 of this property is "GET". This will produce the same behavior as a web browser (such as FireFox). If this property is set to the empty string, then it will cause the same verb as the original HTTP request to be used.

Note: Prior to version 9.5.0.44, the default value of this property was the empty string.

top
Referer
procedure CkHttp_getReferer(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putReferer(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__referer(objHandle: HCkHttp): PWideChar; stdcall;

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.

top
RequiredContentType
procedure CkHttp_getRequiredContentType(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putRequiredContentType(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__requiredContentType(objHandle: HCkHttp): PWideChar; stdcall;

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.

top
RequireSslCertVerify
function CkHttp_getRequireSslCertVerify(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putRequireSslCertVerify(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

If True, then the HTTP client will verify the server's SSL certificate. The certificate is expired, or if the cert's signature is invalid, the connection is not allowed. The default value of this property is False.

top
S3Ssl
function CkHttp_getS3Ssl(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putS3Ssl(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

If True, then all S3_* methods will use a secure SSL/TLS connection for communications. (If True, Chilkat uses TLS 1.2) The default value is True.

top
SaveCookies
function CkHttp_getSaveCookies(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putSaveCookies(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

More Information and Examples
top
SendBufferSize
function CkHttp_getSendBufferSize(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putSendBufferSize(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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

top
SendCookies
function CkHttp_getSendCookies(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putSendCookies(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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.

More Information and Examples
top
SessionLogFilename
procedure CkHttp_getSessionLogFilename(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putSessionLogFilename(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__sessionLogFilename(objHandle: HCkHttp): PWideChar; stdcall;

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.

More Information and Examples
top
SocksHostname
procedure CkHttp_getSocksHostname(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putSocksHostname(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__socksHostname(objHandle: HCkHttp): PWideChar; stdcall;

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).

top
SocksPassword
procedure CkHttp_getSocksPassword(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putSocksPassword(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__socksPassword(objHandle: HCkHttp): PWideChar; stdcall;

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

top
SocksPort
function CkHttp_getSocksPort(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putSocksPort(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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).

top
SocksUsername
procedure CkHttp_getSocksUsername(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putSocksUsername(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__socksUsername(objHandle: HCkHttp): PWideChar; stdcall;

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

top
SocksVersion
function CkHttp_getSocksVersion(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putSocksVersion(objHandle: HCkHttp; newPropVal: Integer); stdcall;

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.

top
SoRcvBuf
function CkHttp_getSoRcvBuf(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putSoRcvBuf(objHandle: HCkHttp; newPropVal: Integer); stdcall;

Sets the receive buffer size socket option. Normally, this property should be left unchanged. The default value is 4194304.

This property can be increased if download performance seems slow. It is recommended to be a multiple of 4096.

top
SoSndBuf
function CkHttp_getSoSndBuf(objHandle: HCkHttp): Integer; stdcall;
procedure CkHttp_putSoSndBuf(objHandle: HCkHttp; newPropVal: Integer); stdcall;

Sets the send buffer size socket option. Normally, this property should be left unchanged. The default value is 262144.

This property can be increased if upload performance seems slow. It is recommended to be a multiple of 4096. Testing with sizes such as 512K and 1MB is reasonable.

top
SslAllowedCiphers
procedure CkHttp_getSslAllowedCiphers(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putSslAllowedCiphers(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__sslAllowedCiphers(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.48

Provides a means for setting a list of ciphers that are allowed for SSL/TLS connections. The default (empty string) indicates that all implemented ciphers are possible. The TLS ciphers supported in Chilkat v9.5.0.55 and later are:

TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA256
TLS_RSA_WITH_AES_256_GCM_SHA384
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_MD5
TLS_DHE_RSA_WITH_DES_CBC_SHA
TLS_RSA_WITH_DES_CBC_SHA
To restrict SSL/TLS connections to one or more specific ciphers, set this property to a comma-separated list of ciphers such as "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384". The order should be in terms of preference, with the preferred algorithms listed first. (Note that the client cannot specifically choose the algorithm is picked because it is the server that chooses. The client simply provides the server with a list from which to choose.)

The property can also disallow connections with servers having certificates with RSA keys less than a certain size. By default, server certificates having RSA keys of 512 bits or greater are allowed. Add the keyword "rsa1024" to disallow connections with servers having keys smaller than 1024 bits. Add the keyword "rsa2048" to disallow connections with servers having keys smaller than 2048 bits.

Note: Prior to Chilkat v9.5.0.55, it was not possible to explicitly list allowed cipher suites. The deprecated means for indicating allowed ciphers was both incomplete and unprecise. For example, the following keywords could be listed to allow matching ciphers: "aes256-cbc", "aes128-cbc", "3des-cbc", and "rc4". These keywords will still be recognized, but programs should be updated to explicitly list the allowed ciphers.

secure-renegotiation: Starting in Chilkat v9.5.0.55, the keyword "secure-renegotiation" may be added to require that all renegotions be done securely (as per RFC 5746).

best-practices: Starting in Chilkat v9.5.0.55, this property may be set to the single keyword "best-practices". This will allow ciphers based on the current best practices. As new versions of Chilkat are released, the best practices may change. Changes will be noted here. The current best practices are:

  • If the server uses an RSA key, it must be 1024 bits or greater.
  • All renegotations must be secure renegotiations.
  • All ciphers using RC4, DES, or 3DES are disallowed.

Example: The following string would restrict to 2 specific cipher suites, require RSA keys to be 1024 bits or greater, and require secure renegotiations: "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, rsa1024, secure-renegotiation"

top
SslProtocol
procedure CkHttp_getSslProtocol(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putSslProtocol(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__sslProtocol(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.46

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

default
TLS 1.2
TLS 1.1
TLS 1.0
SSL 3.0
TLS 1.2 or higher
TLS 1.1 or higher
TLS 1.0 or higher
The default value is "default" which will choose the, which allows for the protocol to be selected dynamically at runtime based on the requirements of the server. Choosing an exact protocol will cause the connection to fail unless that exact protocol is negotiated. It is better to choose "X or higher" than an exact protocol. The "default" is effectively "SSL 3.0 or higher".

top
StreamResponseBodyPath
procedure CkHttp_getStreamResponseBodyPath(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putStreamResponseBodyPath(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__streamResponseBodyPath(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.49

Allows for the HTTP response body to be streamed directly into a file. If this property is set, then any method returning an HTTP response object will stream the response body directly to the file path specified. The HTTP response object will still contain the response header. (This property is useful when the HTTP response is too large to fit into memory.)

top
TlsCipherSuite
procedure CkHttp_getTlsCipherSuite(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__tlsCipherSuite(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.49

Contains the current or last negotiated TLS cipher suite. If no TLS connection has yet to be established, or if a connection as attempted and failed, then this will be empty. A sample cipher suite string looks like this: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256.

top
TlsPinSet
procedure CkHttp_getTlsPinSet(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putTlsPinSet(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__tlsPinSet(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.55

Specifies a set of pins for Public Key Pinning for TLS connections. This property lists the expected SPKI fingerprints for the server certificates. If the server's certificate (sent during the TLS handshake) does not match any of the SPKI fingerprints, then the TLS handshake is aborted and the connection fails. The format of this string property is as follows:

hash_algorithm, encoding, SPKI_fingerprint_1, SPKI_fingerprint_2, ...
For example, the following string specifies a single sha256 base64-encoded SPKI fingerprint:
"sha256, base64, lKg1SIqyhPSK19tlPbjl8s02yChsVTDklQpkMCHvsTE="
This example specifies two SPKI fingerprints:
"sha256, base64, 4t37LpnGmrMEAG8HEz9yIrnvJV2euVRwCLb9EH5WZyI=, 68b0G5iqMvWVWvUCjMuhLEyekM5729PadtnU5tdXZKs="
Any of the following hash algorithms are allowed:.sha1, sha256, sha384, sha512, md2, md5, haval, ripemd128, ripemd160,ripemd256, or ripemd320.

The following encodings are allowed: base64, hex, and any of the encodings indicated in the link below.

top
TlsVersion
procedure CkHttp_getTlsVersion(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__tlsVersion(objHandle: HCkHttp): PWideChar; stdcall;
Introduced in version 9.5.0.49

Contains the current or last negotiated TLS protocol version. If no TLS connection has yet to be established, or if a connection as attempted and failed, then this will be empty. Possible values are "SSL 3.0", "TLS 1.0", "TLS 1.1", and "TLS 1.2".

top
UpdateCache
function CkHttp_getUpdateCache(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putUpdateCache(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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

top
UseIEProxy
function CkHttp_getUseIEProxy(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putUseIEProxy(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

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

top
UserAgent
procedure CkHttp_getUserAgent(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
procedure CkHttp_putUserAgent(objHandle: HCkHttp; newPropVal: PWideChar); stdcall;
function CkHttp__userAgent(objHandle: HCkHttp): PWideChar; stdcall;

The UserAgent header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0". The reason for this default is to get the same server behavior for a recent version of a typical and popular browser. Some sites may respond differently depending on the User-Agent, and the goal is to avoid strange responses that are different than what a typical browser would receive.

top
VerboseLogging
function CkHttp_getVerboseLogging(objHandle: HCkHttp): wordbool; stdcall;
procedure CkHttp_putVerboseLogging(objHandle: HCkHttp; newPropVal: wordbool); stdcall;

If set to True, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is False. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

top
Version
procedure CkHttp_getVersion(objHandle: HCkHttp; outPropVal: HCkString); stdcall;
function CkHttp__version(objHandle: HCkHttp): PWideChar; stdcall;

Version of the component/library, such as "9.5.0.63"

top
WasRedirected
function CkHttp_getWasRedirected(objHandle: HCkHttp): wordbool; stdcall;

Indicates whether the last HTTP GET was redirected.

top

Methods

AddCacheRoot
procedure CkHttp_AddCacheRoot(objHandle: HCkHttp;
    dir: PWideChar) stdcall;

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.

top
ClearInMemoryCookies
procedure CkHttp_ClearInMemoryCookies(objHandle: HCkHttp) stdcall;

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

top
ClearUrlVars
procedure CkHttp_ClearUrlVars(objHandle: HCkHttp) stdcall;
Introduced in version 9.5.0.67

Clears all URL variable values previously set by one or more calls to SetUrlVar.

top
CloseAllConnections
function CkHttp_CloseAllConnections(objHandle: HCkHttp): wordbool; stdcall;

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.

Returns True for success, False for failure.

top
CloseAllConnectionsAsync (1)
function CkHttp_CloseAllConnectionsAsync(objHandle: HCkHttp): HCkTask; stdcall;

Creates an asynchronous task to call the CloseAllConnections method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
DnsCacheClear
procedure CkHttp_DnsCacheClear(objHandle: HCkHttp) stdcall;
Introduced in version 9.5.0.38

Clears the Chilkat-wide in-memory hostname-to-IP address DNS cache. Chilkat automatically maintains this in-memory cache to prevent redundant DNS lookups. If the TTL on the DNS A records being accessed are short and/or these DNS records change frequently, then this method can be called clear the internal cache. Note: The DNS cache is used/shared among all Chilkat objects in a program, and clearing the cache affects all Chilkat objects.

top
Download
function CkHttp_Download(objHandle: HCkHttp;
    url: PWideChar;
    localFilePath: PWideChar): wordbool; stdcall;

Retrieves the content at a URL and saves to a file. All content is saved 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.

top
DownloadAsync (1)
function CkHttp_DownloadAsync(objHandle: HCkHttp;
    url: PWideChar;
    localFilePath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the Download method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
DownloadAppend
function CkHttp_DownloadAppend(objHandle: HCkHttp;
    url: PWideChar;
    filename: PWideChar): wordbool; stdcall;

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

Returns True for success, False for failure.

top
DownloadAppendAsync (1)
function CkHttp_DownloadAppendAsync(objHandle: HCkHttp;
    url: PWideChar;
    filename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the DownloadAppend method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
DownloadBd
function CkHttp_DownloadBd(objHandle: HCkHttp;
    url: PWideChar;
    binData: HCkBinData): wordbool; stdcall;
Introduced in version 9.5.0.63

Downloads the content at the url into a BinData object.

Returns True for success, False for failure.

top
DownloadBdAsync (1)
function CkHttp_DownloadBdAsync(objHandle: HCkHttp;
    url: PWideChar;
    binData: HCkBinData): HCkTask; stdcall;
Introduced in version 9.5.0.63

Creates an asynchronous task to call the DownloadBd method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
DownloadHash
function CkHttp_DownloadHash(objHandle: HCkHttp;
    url: PWideChar;
    hashAlgorithm: PWideChar;
    encoding: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__downloadHash(objHandle: HCkHttp;
    url: PWideChar;
    hashAlgorithm: PWideChar;
    encoding: PWideChar): PWideChar; stdcall;

Retrieves the content at a URL and computes and returns a hash of the content. The hash is returned as an encoded string according to the encoding, which may be "Base64", "modBase64", "Base32", "UU", "QP" (for quoted-printable), "URL" (for url-encoding), "Hex", "Q", "B", "url_oath", "url_rfc1738", "url_rfc2396", and "url_rfc3986". The hashAlgorithm may be "sha1", "sha256", "sha384", "sha512", "md2", "md5", "haval", "ripemd128", "ripemd160","ripemd256", or "ripemd320".

Returns True for success, False for failure.

top
DownloadHashAsync (1)
function CkHttp_DownloadHashAsync(objHandle: HCkHttp;
    url: PWideChar;
    hashAlgorithm: PWideChar;
    encoding: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the DownloadHash method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
DownloadSb
function CkHttp_DownloadSb(objHandle: HCkHttp;
    url: PWideChar;
    charset: PWideChar;
    sb: HCkStringBuilder): wordbool; stdcall;
Introduced in version 9.5.0.63

Downloads the content at the url into a Chilkat StringBuilder object. The charset tells Chilkat how to interpret the bytes received. The sb is appended with the downloaded text data.

Returns True for success, False for failure.

top
DownloadSbAsync (1)
function CkHttp_DownloadSbAsync(objHandle: HCkHttp;
    url: PWideChar;
    charset: PWideChar;
    sb: HCkStringBuilder): HCkTask; stdcall;
Introduced in version 9.5.0.63

Creates an asynchronous task to call the DownloadSb method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
ExtractMetaRefreshUrl
function CkHttp_ExtractMetaRefreshUrl(objHandle: HCkHttp;
    htmlContent: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__extractMetaRefreshUrl(objHandle: HCkHttp;
    htmlContent: PWideChar): PWideChar; stdcall;

Convenience method for extracting the META refresh URL from HTML. For example, if the htmlContent contains a META refresh tag, such as:

<meta http-equiv="refresh" content="5;URL='http://example.com/'">
Then the return value of this method would be "http://example.com/".

Returns True for success, False for failure.

top
G_SvcOauthAccessToken
function CkHttp_G_SvcOauthAccessToken(objHandle: HCkHttp;
    iss: PWideChar;
    scope: PWideChar;
    subEmail: PWideChar;
    numSec: Integer;
    cert: HCkCert;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__g_SvcOauthAccessToken(objHandle: HCkHttp;
    iss: PWideChar;
    scope: PWideChar;
    subEmail: PWideChar;
    numSec: Integer;
    cert: HCkCert): PWideChar; stdcall;
Introduced in version 9.5.0.44

Makes an access token request to obtain a Google API OAuth2 access token for a service account. Access tokens issued by the Google OAuth 2.0 Authorization Server expire one hour after they are issued. When an access token expires, then the application should generate another JWT, sign it, and request another access token. The iss is the service account email address of the application making the access token request. The scope is a space-delimited list of the permissions that the application requests. (See https://developers.google.com/accounts/docs/OAuth2ServiceAccount )

The subEmail is the email address of the user for which the application is requesting delegated access. The subEmail may be left empty if there is no such email address.

Returns True for success, False for failure.

top
G_SvcOauthAccessTokenAsync (1)
function CkHttp_G_SvcOauthAccessTokenAsync(objHandle: HCkHttp;
    iss: PWideChar;
    scope: PWideChar;
    subEmail: PWideChar;
    numSec: Integer;
    cert: HCkCert): HCkTask; stdcall;
Introduced in version 9.5.0.44

Creates an asynchronous task to call the G_SvcOauthAccessToken method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
G_SvcOauthAccessToken2
function CkHttp_G_SvcOauthAccessToken2(objHandle: HCkHttp;
    claimParams: HCkHashtable;
    numSec: Integer;
    cert: HCkCert;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__g_SvcOauthAccessToken2(objHandle: HCkHttp;
    claimParams: HCkHashtable;
    numSec: Integer;
    cert: HCkCert): PWideChar; stdcall;
Introduced in version 9.5.0.51

The same as the G_SvcOauthAccessToken method, but with added flexibility for more customization. The 1st three args of the G_SvcOauthAccessToken are replaced with claimParams allowing for future expansion of name-value params. See the example below.

Returns True for success, False for failure.

top
G_SvcOauthAccessToken2Async (1)
function CkHttp_G_SvcOauthAccessToken2Async(objHandle: HCkHttp;
    claimParams: HCkHashtable;
    numSec: Integer;
    cert: HCkCert): HCkTask; stdcall;
Introduced in version 9.5.0.51

Creates an asynchronous task to call the G_SvcOauthAccessToken2 method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
GenTimeStamp
function CkHttp_GenTimeStamp(objHandle: HCkHttp;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__genTimeStamp(objHandle: HCkHttp): PWideChar; stdcall;

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.

top
GetCacheRoot
function CkHttp_GetCacheRoot(objHandle: HCkHttp;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__getCacheRoot(objHandle: HCkHttp;
    index: Integer): PWideChar; stdcall;

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.

top
GetCookieXml
function CkHttp_GetCookieXml(objHandle: HCkHttp;
    domain: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__getCookieXml(objHandle: HCkHttp;
    domain: PWideChar): PWideChar; stdcall;

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.

top
GetDomain
function CkHttp_GetDomain(objHandle: HCkHttp;
    url: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__getDomain(objHandle: HCkHttp;
    url: PWideChar): PWideChar; stdcall;

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.

top
GetHead
function CkHttp_GetHead(objHandle: HCkHttp;
    url: PWideChar): HCkHttpResponse; stdcall;

Sends an HTTP HEAD request for a URL and returns a response object. (Note: HEAD requests will never automatically follow redirects.)

Returns nil on failure

More Information and Examples
top
GetHeadAsync (1) (2)
function CkHttp_GetHeadAsync(objHandle: HCkHttp;
    url: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the GetHead method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
GetRequestHeader
function CkHttp_GetRequestHeader(objHandle: HCkHttp;
    name: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__getRequestHeader(objHandle: HCkHttp;
    name: PWideChar): PWideChar; stdcall;

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.

top
GetServerSslCert
function CkHttp_GetServerSslCert(objHandle: HCkHttp;
    domain: PWideChar;
    port: Integer): HCkCert; stdcall;

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.

Returns nil on failure

top
GetServerSslCertAsync (1) (2)
function CkHttp_GetServerSslCertAsync(objHandle: HCkHttp;
    domain: PWideChar;
    port: Integer): HCkTask; stdcall;

Creates an asynchronous task to call the GetServerSslCert method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
GetUrlPath
function CkHttp_GetUrlPath(objHandle: HCkHttp;
    url: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__getUrlPath(objHandle: HCkHttp;
    url: PWideChar): PWideChar; stdcall;

Returns the path part of a URL. The syntax of a URL is <scheme>://<user>:<password>@<host>:<port>/<path>;<params>?<query>#<frag>. This method returns the "path" part.

Returns True for success, False for failure.

top
HasRequestHeader
function CkHttp_HasRequestHeader(objHandle: HCkHttp;
    name: PWideChar): wordbool; stdcall;

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.

top
IsUnlocked
function CkHttp_IsUnlocked(objHandle: HCkHttp): wordbool; stdcall;

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.

top
PBinary
function CkHttp_PBinary(objHandle: HCkHttp;
    verb: PWideChar;
    url: PWideChar;
    byteData: HCkByteData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkHttpResponse; stdcall;
Introduced in version 9.5.0.45

Sends an HTTP request to the url. The verb can be "POST", "PUT", "PATCH", etc. The body of the HTTP request contains the bytes passed in 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 nil on failure

top
PBinaryAsync (1) (2)
function CkHttp_PBinaryAsync(objHandle: HCkHttp;
    verb: PWideChar;
    url: PWideChar;
    byteData: HCkByteData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkTask; stdcall;
Introduced in version 9.5.0.45

Creates an asynchronous task to call the PBinary method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PBinaryBd
function CkHttp_PBinaryBd(objHandle: HCkHttp;
    verb: PWideChar;
    url: PWideChar;
    data: HCkBinData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkHttpResponse; stdcall;
Introduced in version 9.5.0.69

The same as PBinary, but the data to be uploaded is passed in data.

Returns nil on failure

top
PBinaryBdAsync (1) (2)
function CkHttp_PBinaryBdAsync(objHandle: HCkHttp;
    verb: PWideChar;
    url: PWideChar;
    data: HCkBinData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkTask; stdcall;
Introduced in version 9.5.0.69

Creates an asynchronous task to call the PBinaryBd method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PostBinary
function CkHttp_PostBinary(objHandle: HCkHttp;
    url: PWideChar;
    byteData: HCkByteData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__postBinary(objHandle: HCkHttp;
    url: PWideChar;
    byteData: HCkByteData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): PWideChar; stdcall;

Sends an HTTP POST request to the url. The body of the HTTP request contains the bytes passed in 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 the text body of the HTTP response if the HTTP response has a success status code. Otherwise the method is considered to have failed. If more details of the HTTP response are required, call PBinary instead (which returns the HTTP response object).

Note: The HTTP response code is available in the LastStatus property. Other properties having information include LastResponseHeader, LastResponseBody, LastModDate, LastContentType, etc.

Returns True for success, False for failure.

top
PostBinaryAsync (1)
function CkHttp_PostBinaryAsync(objHandle: HCkHttp;
    url: PWideChar;
    byteData: HCkByteData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkTask; stdcall;

Creates an asynchronous task to call the PostBinary method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PostJson
function CkHttp_PostJson(objHandle: HCkHttp;
    url: PWideChar;
    jsonText: PWideChar): HCkHttpResponse; stdcall;

A simplified way of sending a JSON POST and receiving the JSON response. The HTTP response is returned in an HTTP response object. The content type of the HTTP request is "applicatoin/jsonrequest". To send a JSON POST using "application/json", call the PostJson2 method where the content type can be explicitly provided.

Returns nil on failure

More Information and Examples
top
PostJsonAsync (1) (2)
function CkHttp_PostJsonAsync(objHandle: HCkHttp;
    url: PWideChar;
    jsonText: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the PostJson method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PostJson2
function CkHttp_PostJson2(objHandle: HCkHttp;
    url: PWideChar;
    contentType: PWideChar;
    jsonText: PWideChar): HCkHttpResponse; stdcall;

The same as PostJson,except it allows for the content type to be explicitly provided. The PostJson method automatically uses "application/jsonrequest". If the application needs for the content type to be "application/json", or some other content type, then PostJson2 provides the means.

Returns nil on failure

top
PostJson2Async (1) (2)
function CkHttp_PostJson2Async(objHandle: HCkHttp;
    url: PWideChar;
    contentType: PWideChar;
    jsonText: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the PostJson2 method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PostJson3
function CkHttp_PostJson3(objHandle: HCkHttp;
    url: PWideChar;
    contentType: PWideChar;
    json: HCkJsonObject): HCkHttpResponse; stdcall;
Introduced in version 9.5.0.68

The same as PostJson2,except a JSON object is passed in for the request body.

Returns nil on failure

top
PostJson3Async (1) (2)
function CkHttp_PostJson3Async(objHandle: HCkHttp;
    url: PWideChar;
    contentType: PWideChar;
    json: HCkJsonObject): HCkTask; stdcall;
Introduced in version 9.5.0.68

Creates an asynchronous task to call the PostJson3 method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PostUrlEncoded
function CkHttp_PostUrlEncoded(objHandle: HCkHttp;
    url: PWideChar;
    req: HCkHttpRequest): HCkHttpResponse; stdcall;

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".

Returns nil on failure

top
PostUrlEncodedAsync (1) (2)
function CkHttp_PostUrlEncodedAsync(objHandle: HCkHttp;
    url: PWideChar;
    req: HCkHttpRequest): HCkTask; stdcall;

Creates an asynchronous task to call the PostUrlEncoded method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PostXml
function CkHttp_PostXml(objHandle: HCkHttp;
    endpointUrl: PWideChar;
    xmlContent: PWideChar;
    xmlCharset: PWideChar): HCkHttpResponse; stdcall;

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.

Important: This method sends the POST with a "Content-Type" header value of "text/xml". Sometimes a server might require the Content-Type header to be "application/xml". To use "application/xml" instead of the default "text/xml", call SetRequestHeader("Content-Type","application/xml") prior to calling this method.

To use HTTPS simply pass an endpointUrl beginning with "https://" instead of "http://". This applies to any Chilkat method where a URL is passed as an argument.

Returns nil on failure

top
PostXmlAsync (1) (2)
function CkHttp_PostXmlAsync(objHandle: HCkHttp;
    endpointUrl: PWideChar;
    xmlContent: PWideChar;
    xmlCharset: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the PostXml method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PText
function CkHttp_PText(objHandle: HCkHttp;
    verb: PWideChar;
    url: PWideChar;
    textData: PWideChar;
    charset: PWideChar;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkHttpResponse; stdcall;
Introduced in version 9.5.0.46

Sends an HTTP request to the url. The verb can be "POST", "PUT", "PATCH", etc. The body of the HTTP request contains the text passed in textData. The contentType is a content type such as "text/xml", "application/json", 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 contentType 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 nil on failure

top
PTextAsync (1) (2)
function CkHttp_PTextAsync(objHandle: HCkHttp;
    verb: PWideChar;
    url: PWideChar;
    textData: PWideChar;
    charset: PWideChar;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkTask; stdcall;
Introduced in version 9.5.0.46

Creates an asynchronous task to call the PText method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PTextSb
function CkHttp_PTextSb(objHandle: HCkHttp;
    verb: PWideChar;
    url: PWideChar;
    textData: HCkStringBuilder;
    charset: PWideChar;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkHttpResponse; stdcall;
Introduced in version 9.5.0.69

The same as PText, but the data to be uploaded is passed in textData.

Returns nil on failure

More Information and Examples
top
PTextSbAsync (1) (2)
function CkHttp_PTextSbAsync(objHandle: HCkHttp;
    verb: PWideChar;
    url: PWideChar;
    textData: HCkStringBuilder;
    charset: PWideChar;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkTask; stdcall;
Introduced in version 9.5.0.69

Creates an asynchronous task to call the PTextSb method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PutBinary
function CkHttp_PutBinary(objHandle: HCkHttp;
    url: PWideChar;
    byteData: HCkByteData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__putBinary(objHandle: HCkHttp;
    url: PWideChar;
    byteData: HCkByteData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): PWideChar; stdcall;

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 the text body of the HTTP response if the HTTP response has a success status code. Otherwise the method is considered to have failed. If more details of the HTTP response are required, call PBinary instead (which returns the HTTP response object).

Returns True for success, False for failure.

top
PutBinaryAsync (1)
function CkHttp_PutBinaryAsync(objHandle: HCkHttp;
    url: PWideChar;
    byteData: HCkByteData;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkTask; stdcall;

Creates an asynchronous task to call the PutBinary method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
PutText
function CkHttp_PutText(objHandle: HCkHttp;
    url: PWideChar;
    textData: PWideChar;
    charset: PWideChar;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__putText(objHandle: HCkHttp;
    url: PWideChar;
    textData: PWideChar;
    charset: PWideChar;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): PWideChar; stdcall;

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 the text body of the HTTP response if the HTTP response has a success status code. Otherwise the method is considered to have failed. If more details of the HTTP response are required, call PText instead (which returns the HTTP response object).

Returns True for success, False for failure.

More Information and Examples
top
PutTextAsync (1)
function CkHttp_PutTextAsync(objHandle: HCkHttp;
    url: PWideChar;
    textData: PWideChar;
    charset: PWideChar;
    contentType: PWideChar;
    md5: wordbool;
    gzip: wordbool): HCkTask; stdcall;

Creates an asynchronous task to call the PutText method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
QuickDeleteStr
function CkHttp_QuickDeleteStr(objHandle: HCkHttp;
    url: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__quickDeleteStr(objHandle: HCkHttp;
    url: PWideChar): PWideChar; stdcall;

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

Note: The HTTP response code is available in the LastStatus property. Other properties having information include LastResponseHeader, LastResponseBody, LastModDate, LastContentType, etc.

Returns True for success, False for failure.

More Information and Examples
top
QuickDeleteStrAsync (1)
function CkHttp_QuickDeleteStrAsync(objHandle: HCkHttp;
    url: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the QuickDeleteStr method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
QuickGet
function CkHttp_QuickGet(objHandle: HCkHttp;
    url: PWideChar;
    outData: HCkByteData): wordbool; stdcall;

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.

Note: The HTTP response code is available in the LastStatus property. Other properties having information include LastResponseHeader, LastResponseBody, LastModDate, LastContentType, etc.

Returns True for success, False for failure.

top
QuickGetAsync (1)
function CkHttp_QuickGetAsync(objHandle: HCkHttp;
    url: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the QuickGet method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
QuickGetBd
function CkHttp_QuickGetBd(objHandle: HCkHttp;
    url: PWideChar;
    binData: HCkBinData): wordbool; stdcall;
Introduced in version 9.5.0.64

The same as QuickGet, but returns the content in a Chilkat BinData object. The existing content of binData, if any, is cleared and replaced with the downloaded content.

Returns True for success, False for failure.

More Information and Examples
top
QuickGetBdAsync (1)
function CkHttp_QuickGetBdAsync(objHandle: HCkHttp;
    url: PWideChar;
    binData: HCkBinData): HCkTask; stdcall;
Introduced in version 9.5.0.64

Creates an asynchronous task to call the QuickGetBd method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
QuickGetObj
function CkHttp_QuickGetObj(objHandle: HCkHttp;
    url: PWideChar): HCkHttpResponse; stdcall;

Sends an HTTP GET request for a URL and returns the response object. 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.

Returns nil on failure

top
QuickGetObjAsync (1) (2)
function CkHttp_QuickGetObjAsync(objHandle: HCkHttp;
    url: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the QuickGetObj method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
QuickGetSb
function CkHttp_QuickGetSb(objHandle: HCkHttp;
    url: PWideChar;
    sbContent: HCkStringBuilder): wordbool; stdcall;
Introduced in version 9.5.0.64

The same as QuickGetStr, but returns the content in a Chilkat StringBuilder object. The existing content of sbContent, if any, is cleared and replaced with the downloaded content.

Returns True for success, False for failure.

top
QuickGetSbAsync (1)
function CkHttp_QuickGetSbAsync(objHandle: HCkHttp;
    url: PWideChar;
    sbContent: HCkStringBuilder): HCkTask; stdcall;
Introduced in version 9.5.0.64

Creates an asynchronous task to call the QuickGetSb method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
QuickGetStr
function CkHttp_QuickGetStr(objHandle: HCkHttp;
    url: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__quickGetStr(objHandle: HCkHttp;
    url: PWideChar): PWideChar; stdcall;

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 nil value is returned and error information can be found in the LastErrorText, LastErrorXml, or LastErrorHtml properties.

Note: The HTTP response code is available in the LastStatus property. Other properties having information include LastResponseHeader, LastResponseBody, LastModDate, LastContentType, etc.

Returns True for success, False for failure.

top
QuickGetStrAsync (1)
function CkHttp_QuickGetStrAsync(objHandle: HCkHttp;
    url: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the QuickGetStr method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
QuickPutStr
function CkHttp_QuickPutStr(objHandle: HCkHttp;
    url: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__quickPutStr(objHandle: HCkHttp;
    url: PWideChar): PWideChar; stdcall;

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

Note: The HTTP response code is available in the LastStatus property. Other properties having information include LastResponseHeader, LastResponseBody, LastModDate, LastContentType, etc.

Returns True for success, False for failure.

More Information and Examples
top
QuickPutStrAsync (1)
function CkHttp_QuickPutStrAsync(objHandle: HCkHttp;
    url: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the QuickPutStr method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
RemoveQuickHeader
function CkHttp_RemoveQuickHeader(objHandle: HCkHttp;
    headerFieldName: PWideChar): wordbool; stdcall;

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.)

* Note: This method is deprecated. It is identical to the RemoveRequestHeader method. The RemoveRequestHeader method should be called instead because this method will be removed in a future version.

Returns True for success, False for failure.

top
RemoveRequestHeader
procedure CkHttp_RemoveRequestHeader(objHandle: HCkHttp;
    name: PWideChar) stdcall;

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 SetRequestHeader method is called to add custom header fields.)

top
RenderGet
function CkHttp_RenderGet(objHandle: HCkHttp;
    url: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__renderGet(objHandle: HCkHttp;
    url: PWideChar): PWideChar; stdcall;

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.

top
ResumeDownload
function CkHttp_ResumeDownload(objHandle: HCkHttp;
    url: PWideChar;
    targetFilename: PWideChar): wordbool; stdcall;

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.

top
ResumeDownloadAsync (1)
function CkHttp_ResumeDownloadAsync(objHandle: HCkHttp;
    url: PWideChar;
    targetFilename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the ResumeDownload method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_CreateBucket
function CkHttp_S3_CreateBucket(objHandle: HCkHttp;
    bucketPath: PWideChar): wordbool; stdcall;

Creates a new Amazon S3 bucket.

Note: x-amz-* headers, including metadata, can be added to any S3 request by adding each header with a call to SetRequestHeader. This applies to all S3 methods, even if not explicitly stated.

Returns True for success, False for failure.

More Information and Examples
top
S3_CreateBucketAsync (1)
function CkHttp_S3_CreateBucketAsync(objHandle: HCkHttp;
    bucketPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_CreateBucket method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_DeleteBucket
function CkHttp_S3_DeleteBucket(objHandle: HCkHttp;
    bucketPath: PWideChar): wordbool; stdcall;

Deletes an Amazon S3 bucket.

Returns True for success, False for failure.

More Information and Examples
top
S3_DeleteBucketAsync (1)
function CkHttp_S3_DeleteBucketAsync(objHandle: HCkHttp;
    bucketPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_DeleteBucket method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_DeleteMultipleObjects
function CkHttp_S3_DeleteMultipleObjects(objHandle: HCkHttp;
    bucketName: PWideChar;
    objectNames: HCkStringArray): HCkHttpResponse; stdcall;
Introduced in version 9.5.0.47

Deletes multiple objects from a bucket using a single HTTP request. The bucketName contains the names (also known as "keys") of the objects to be deleted. To delete a specific version of an object, append a versionId attribute to the object name. For example: "SampleDocument.txt; VersionId="OYcLXagmS.WaD..oyH4KRguB95_YhLs7""

Returns nil on failure

More Information and Examples
top
S3_DeleteMultipleObjectsAsync (1) (2)
function CkHttp_S3_DeleteMultipleObjectsAsync(objHandle: HCkHttp;
    bucketName: PWideChar;
    objectNames: HCkStringArray): HCkTask; stdcall;
Introduced in version 9.5.0.47

Creates an asynchronous task to call the S3_DeleteMultipleObjects method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_DeleteObject
function CkHttp_S3_DeleteObject(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar): wordbool; stdcall;

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

Returns True for success, False for failure.

More Information and Examples
top
S3_DeleteObjectAsync (1)
function CkHttp_S3_DeleteObjectAsync(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_DeleteObject method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_DownloadBytes
function CkHttp_S3_DownloadBytes(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar;
    outBytes: HCkByteData): wordbool; stdcall;

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

Returns True for success, False for failure.

More Information and Examples
top
S3_DownloadBytesAsync (1)
function CkHttp_S3_DownloadBytesAsync(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_DownloadBytes method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_DownloadFile
function CkHttp_S3_DownloadFile(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar;
    localFilePath: PWideChar): wordbool; stdcall;

Downloads a file from the Amazon S3 service.

Returns True for success, False for failure.

More Information and Examples
top
S3_DownloadFileAsync (1)
function CkHttp_S3_DownloadFileAsync(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar;
    localFilePath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_DownloadFile method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_DownloadString
function CkHttp_S3_DownloadString(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar;
    charset: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__s3_DownloadString(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar;
    charset: PWideChar): PWideChar; stdcall;

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.

More Information and Examples
top
S3_DownloadStringAsync (1)
function CkHttp_S3_DownloadStringAsync(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar;
    charset: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_DownloadString method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_FileExists
function CkHttp_S3_FileExists(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar): Integer; stdcall;

Determines if a remote object (file) exists. Returns 1 if the file exists, 0 if it does not exist, -1 if there was a failure in checking, or 2 if using in asynchronous mode to indicate that the background task was successfully started.

top
S3_FileExistsAsync (1)
function CkHttp_S3_FileExistsAsync(objHandle: HCkHttp;
    bucketPath: PWideChar;
    objectName: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_FileExists method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_GenerateUrl
function CkHttp_S3_GenerateUrl(objHandle: HCkHttp;
    bucket: PWideChar;
    path: PWideChar;
    expire: HCkDateTime;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__s3_GenerateUrl(objHandle: HCkHttp;
    bucket: PWideChar;
    path: PWideChar;
    expire: HCkDateTime): PWideChar; stdcall;
Introduced in version 9.5.0.46

Generates a temporary pre-signed URL for Amazon S3 using AWS Signature V2. (Call S3_GenerateUrlV4 to generate AWS Signature V4 pre-signed URLs.) Requires that the AwsSecretKey and AwsAccessKey be set to valid values prior to calling this method.

Note: This method can only generate URLs that are for HTTP GET requests (i.e. URLs you can paste into a browser address bar). This method does not generate URLs for POST, PUT, DELETE, etc.

Returns True for success, False for failure.

More Information and Examples
top
S3_GenerateUrlV4
function CkHttp_S3_GenerateUrlV4(objHandle: HCkHttp;
    useHttps: wordbool;
    bucketName: PWideChar;
    path: PWideChar;
    numSecondsValid: Integer;
    awsService: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__s3_GenerateUrlV4(objHandle: HCkHttp;
    useHttps: wordbool;
    bucketName: PWideChar;
    path: PWideChar;
    numSecondsValid: Integer;
    awsService: PWideChar): PWideChar; stdcall;
Introduced in version 9.5.0.66

Generates a temporary pre-signed URL for Amazon S3 using AWS Signature V4. (Call S3_GenerateUrl to generate AWS Signature V2 pre-signed URLs.) Requires that the AwsSecretKey, AwsAccessKey, and AwsRegion properties be set to valid values prior to calling this method. Also requires the AwsEndpoint property to be set if the endpoint is different than "s3.amazonaws.com".

The URL that is generated has this format:

https://<AwsEndpoint>/<bucket_name>/<path>
?X-Amz-Algorithm=AWS4-HMAC-SHA256
&X-Amz-Credential=<AwsAccessKey>/<currentDate>/<AwsRegion>/<awsService>/aws4_request
&X-Amz-Date=<currentDateTime>
&X-Amz-Expires=<numSecondsValid>
&X-Amz-SignedHeaders=host
&X-Amz-Signature=<signature-value>  

The awsService is a string naming the AWS service, such as "s3". If useHttps is True, then the URL begins with "https://", otherwise it begins with "http://".

Note: This method can only generate URLs that are for HTTP GET requests (i.e. URLs you can paste into a browser address bar). This method does not generate URLs for POST, PUT, DELETE, etc.

Returns True for success, False for failure.

top
S3_ListBucketObjects
function CkHttp_S3_ListBucketObjects(objHandle: HCkHttp;
    bucketPath: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__s3_ListBucketObjects(objHandle: HCkHttp;
    bucketPath: PWideChar): PWideChar; stdcall;

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

The bucketPath name may be qualified with URL-encoded params. For example, to list the objects in a bucket named "ChilkatABC" with max-keys = 2000 and marker = "xyz", call S3_ListBucketObject passing the following string for bucketPath: "ChilkatABC?max-keys=2000&marker=xyz"

The S3_ListBucketObjects method recognized all params listed in the AWS documentation for listing objects in a bucket: delimiter, marker, max-keys, and prefix. See Amazon's AWS online documentation for more information.

Returns True for success, False for failure.

More Information and Examples
top
S3_ListBucketObjectsAsync (1)
function CkHttp_S3_ListBucketObjectsAsync(objHandle: HCkHttp;
    bucketPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_ListBucketObjects method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_ListBuckets
function CkHttp_S3_ListBuckets(objHandle: HCkHttp;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__s3_ListBuckets(objHandle: HCkHttp): PWideChar; stdcall;

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

Returns True for success, False for failure.

More Information and Examples
top
S3_ListBucketsAsync (1)
function CkHttp_S3_ListBucketsAsync(objHandle: HCkHttp): HCkTask; stdcall;

Creates an asynchronous task to call the S3_ListBuckets method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_UploadBytes
function CkHttp_S3_UploadBytes(objHandle: HCkHttp;
    contentBytes: HCkByteData;
    contentType: PWideChar;
    bucketPath: PWideChar;
    objectName: PWideChar): wordbool; stdcall;

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

Note: x-amz-* headers, including metadata, can be added to any S3 request by adding each header with a call to SetRequestHeader. This applies to all S3 methods, even if not explicitly stated.

Returns True for success, False for failure.

More Information and Examples
top
S3_UploadBytesAsync (1)
function CkHttp_S3_UploadBytesAsync(objHandle: HCkHttp;
    contentBytes: HCkByteData;
    contentType: PWideChar;
    bucketPath: PWideChar;
    objectName: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_UploadBytes method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_UploadFile
function CkHttp_S3_UploadFile(objHandle: HCkHttp;
    localFilePath: PWideChar;
    contentType: PWideChar;
    bucketPath: PWideChar;
    objectName: PWideChar): wordbool; stdcall;

Uploads a file to the Amazon S3 service.

Note: x-amz-* headers, including metadata, can be added to any S3 request by adding each header with a call to SetRequestHeader. This applies to all S3 methods, even if not explicitly stated.

Returns True for success, False for failure.

More Information and Examples
top
S3_UploadFileAsync (1)
function CkHttp_S3_UploadFileAsync(objHandle: HCkHttp;
    localFilePath: PWideChar;
    contentType: PWideChar;
    bucketPath: PWideChar;
    objectName: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_UploadFile method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
S3_UploadString
function CkHttp_S3_UploadString(objHandle: HCkHttp;
    objectContent: PWideChar;
    charset: PWideChar;
    contentType: PWideChar;
    bucketPath: PWideChar;
    objectName: PWideChar): wordbool; stdcall;

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.

Note: x-amz-* headers, including metadata, can be added to any S3 request by adding each header with a call to SetRequestHeader. This applies to all S3 methods, even if not explicitly stated.

Returns True for success, False for failure.

More Information and Examples
top
S3_UploadStringAsync (1)
function CkHttp_S3_UploadStringAsync(objHandle: HCkHttp;
    objectContent: PWideChar;
    charset: PWideChar;
    contentType: PWideChar;
    bucketPath: PWideChar;
    objectName: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the S3_UploadString method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
SaveLastError
function CkHttp_SaveLastError(objHandle: HCkHttp;
    path: PWideChar): wordbool; stdcall;

Saves the last-error information (the contents of LastErrorXml) to an XML formatted file.

Returns True for success, False for failure.

top
SetCookieXml
function CkHttp_SetCookieXml(objHandle: HCkHttp;
    domain: PWideChar;
    cookieXml: PWideChar): wordbool; stdcall;

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.

top
SetOAuthRsaKey
function CkHttp_SetOAuthRsaKey(objHandle: HCkHttp;
    privKey: HCkPrivateKey): wordbool; stdcall;
Introduced in version 9.5.0.39

Sets the RSA key to be used with OAuth authentication when the RSA-SHA1 OAuth signature method is used (see the OAuthSigMethod property).

Returns True for success, False for failure.

top
SetPassword
function CkHttp_SetPassword(objHandle: HCkHttp;
    password: HCkSecureString): wordbool; stdcall;
Introduced in version 9.5.0.71

Equivalent to setting the Password property, but provides for a more secure way of passing the password in a secure string object.

Returns True for success, False for failure.

More Information and Examples
top
SetRequestHeader
procedure CkHttp_SetRequestHeader(objHandle: HCkHttp;
    headerFieldName: PWideChar;
    headerFieldValue: PWideChar) stdcall;

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 RemoveRequestHeader method can be called to remove a custom header.

Note: Never explicitly set the Content-Length header field. Chilkat will automatically compute the correct length and add the Content-Length header to all POST, PUT, or any other request where the Content-Length needs to be specified. (GET requests always have a 0 length body, and therefore never need a Content-Length header field.)

Note: To add more than one header, call this method once per header field.

More Information and Examples
top
SetSslClientCert
function CkHttp_SetSslClientCert(objHandle: HCkHttp;
    cert: HCkCert): wordbool; stdcall;

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

Returns True for success, False for failure.

top
SetSslClientCertPem
function CkHttp_SetSslClientCertPem(objHandle: HCkHttp;
    pemDataOrPath: PWideChar;
    pemPassword: PWideChar): wordbool; stdcall;

Allows for a client-side certificate + private key to be used for the SSL / TLS connection (often called 2-way SSL).

Returns True for success, False for failure.

top
SetSslClientCertPfx
function CkHttp_SetSslClientCertPfx(objHandle: HCkHttp;
    pfxPath: PWideChar;
    pfxPassword: PWideChar): wordbool; stdcall;

Allows for a client-side certificate + private key to be used for the SSL / TLS connection (often called 2-way SSL).

Returns True for success, False for failure.

top
SetUrlVar
function CkHttp_SetUrlVar(objHandle: HCkHttp;
    name: PWideChar;
    value: PWideChar): wordbool; stdcall;
Introduced in version 9.5.0.67

Sets the value of a variable for substitutions in URLs passed to any method. Variables can appear in URLs in the following format: {$varName}. For example: https://graph.microsoft.com/v1.0/users/{$id}

Returns True for success, False for failure.

top
SharePointOnlineAuth
function CkHttp_SharePointOnlineAuth(objHandle: HCkHttp;
    siteUrl: PWideChar;
    username: PWideChar;
    password: HCkSecureString;
    extraInfo: HCkJsonObject): wordbool; stdcall;
Introduced in version 9.5.0.73

Authenticates with SharePoint Online, resulting in a cookie being set and used for subsequent SharePoint HTTP requests. Prior to calling this method, an application should set the CookieDir property to either "memory" or a directory path to persist the SharePoint authentication cookie to be automatically used in subsequent runs.

This method has the side-effect of setting the SaveCookies and SendCookies properties to True, because these settings are required for SharePoint Online authentication.

The siteUrl is a URL such as "https://yourdomain.sharepoint.com/". The username is an email address such as "username@yourdomain.com". The extraInfo is reserved for providing additional information as needed in the future.

Returns True for success, False for failure.

More Information and Examples
top
SharePointOnlineAuthAsync (1)
function CkHttp_SharePointOnlineAuthAsync(objHandle: HCkHttp;
    siteUrl: PWideChar;
    username: PWideChar;
    password: HCkSecureString;
    extraInfo: HCkJsonObject): HCkTask; stdcall;
Introduced in version 9.5.0.73

Creates an asynchronous task to call the SharePointOnlineAuth method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
SleepMs
procedure CkHttp_SleepMs(objHandle: HCkHttp;
    millisec: Integer) stdcall;

Convenience method to force the calling process to sleep for a number of milliseconds.

top
SynchronousRequest
function CkHttp_SynchronousRequest(objHandle: HCkHttp;
    domain: PWideChar;
    port: Integer;
    ssl: wordbool;
    req: HCkHttpRequest): HCkHttpResponse; stdcall;

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. To send via HTTPS (i.e. TLS), set the ssl property = True. Otherwise set it to False.

Returns nil on failure

top
SynchronousRequestAsync (1) (2)
function CkHttp_SynchronousRequestAsync(objHandle: HCkHttp;
    domain: PWideChar;
    port: Integer;
    ssl: wordbool;
    req: HCkHttpRequest): HCkTask; stdcall;

Creates an asynchronous task to call the SynchronousRequest method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
UnlockComponent
function CkHttp_UnlockComponent(objHandle: HCkHttp;
    unlockCode: PWideChar): wordbool; stdcall;

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.

top
UrlDecode
function CkHttp_UrlDecode(objHandle: HCkHttp;
    str: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__urlDecode(objHandle: HCkHttp;
    str: PWideChar): PWideChar; stdcall;

URL decodes a string.

Returns True for success, False for failure.

top
UrlEncode
function CkHttp_UrlEncode(objHandle: HCkHttp;
    str: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__urlEncode(objHandle: HCkHttp;
    str: PWideChar): PWideChar; stdcall;

URL encodes a string.

Returns True for success, False for failure.

top
XmlRpc
function CkHttp_XmlRpc(objHandle: HCkHttp;
    urlEndpoint: PWideChar;
    xmlIn: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__xmlRpc(objHandle: HCkHttp;
    urlEndpoint: PWideChar;
    xmlIn: PWideChar): PWideChar; stdcall;

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.

More Information and Examples
top
XmlRpcAsync (1)
function CkHttp_XmlRpcAsync(objHandle: HCkHttp;
    urlEndpoint: PWideChar;
    xmlIn: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the XmlRpc method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
XmlRpcPut
function CkHttp_XmlRpcPut(objHandle: HCkHttp;
    urlEndpoint: PWideChar;
    xmlIn: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkHttp__xmlRpcPut(objHandle: HCkHttp;
    urlEndpoint: PWideChar;
    xmlIn: PWideChar): PWideChar; stdcall;

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

Returns True for success, False for failure.

top
XmlRpcPutAsync (1)
function CkHttp_XmlRpcPutAsync(objHandle: HCkHttp;
    urlEndpoint: PWideChar;
    xmlIn: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the XmlRpcPut method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top