CkHttp Perl Programming
|
| Name | Value |
|---|---|
| SocketConnect | hostname:port, called when initiating a connection. |
| SocketConnected | hostname:port, called after successfully connected. |
| HttpProxyConnect | hostname:port |
| SslHandshake | "Starting"/"Finished" |
| HttpGetBegin | URL |
| HttpCacheHit | "Returning page from cache." |
| HttpInfo | various conditions... "Begin reading response" -- called when beginning to read the response. "Finished reading response" "Existing connection with HTTP server no longer open, restarting GET with new connection." "Reading chunked response." "UnGzipping response data" "Connection:close header is present" |
| GetRequest | the full HTTP GET request to be sent to the server. |
| ResponseHeader | the header of the HTTP response. |
| HttpStatusCode | HTTP response status code (integer) |
| ChunkSize | Size (in bytes) of next chunk in response. |
| ResponseContentLength | Non-chunked response size in bytes. |
| UnGzippedLength | If the response was gzip compressed, this is the uncompressed size. |
| HostnameResolve | hostname, Called when starting to resolve a hostname (to an IP address) |
| ResolvedToIp | dotted IP address, called after hostname is resolved. |
| HttpAuth | one of the following strings: "Starting Negotiate Authentication" "Starting NTLM Authentication" "Adding Basic Authentication Header" "Adding Proxy Authentication Header" "Starting Proxy NTLM Authentication" "Starting Digest Authentication" |
| CookieToSend | Value of a Set-Cookie header field to be added to the outgoing request. |
| SavingCookie | XML of cookie being persisted. |
| HttpRedirect | Redirect URL |
| Socks4Connect | domain:port |
| Socks5Connect | domain:port |
| HttpRequestBegin | Verb (such as POST, GET, PUT), domain:port/path |
| RequestHeader | The full HTTP request header to be sent. |
| StartSendingRequest | Size of entire request, including header, in number of bytes. (Not called for QuickGet) For uploads, this is the size of the entire upload (headers and all files combined) |
| SubPartHeader | The header for one of the parts within a multipart request. |
| UploadFilename | The file about to be uploaded (streamed from file to socket..) |
# Returns an integer value
get_LMFactor( )
# v is an integer (input)
put_LMFactor( v )
An integer between 1 and 100 that indicates the percentage of time from the HTTP page's last-modified date that will be used for the freshness period. The default value is 25. For example, if a page is fetched with a last-modified date of 4 weeks ago, and the LMFactor = 25, then the page will be considered fresh in the cache for 1 week (25% of 4 weeks).
# strContentType is a CkString (output)
get_LastContentType( strContentType )
The content-type of the last HTTP response received by the HTTP component.
# str is a CkString (input)
LastErrorHtml( str )
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.
# str is a CkString (input)
LastErrorText( str )
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.
# str is a CkString (input)
LastErrorXml( str )
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.
# str is a CkString (output)
get_LastHeader( str )
The text of the last HTTP header sent by any of this class's methods. The purpose of this property is to allow the developer to examine the exact HTTP header for debugging purposes.
# str is a CkString (output)
get_LastModDate( str )
The value of the Last-Modified header in the last HTTP response received by the HTTP component.
# strHeader is a CkString (output)
get_LastResponseHeader( strHeader )
The entire last response header for the last HTTP response received by the HTTP component.
# Returns an integer value
get_LastStatus( )
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.
# str is a CkString (output)
get_Login( str )
# v is a string (input)
put_Login( v )
The HTTP login for pages requiring a login/password. Chilkat HTTP can do both Basic and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use NTLM, set the NtlmAuth property = 1.
HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)
# str is a CkString (output)
get_LoginDomain( str )
# newVal is a string (input)
put_LoginDomain( newVal )
The optional domain name to be used with NTLM / Kerberos / Negotiate authentication.
# Returns an integer value
get_MaxConnections( )
# n is an integer (input)
put_MaxConnections( n )
The maximum number of simultaneous open HTTP connections managed by the HTTP component. The Chilkat HTTP component automatically manages HTTP connections. If the number of open HTTP connections is about to be exceeded, the connection with the least recent activity is automatically closed.
# Returns an integer value
get_MaxFreshPeriod( )
# numMinutes is an integer (input)
put_MaxFreshPeriod( numMinutes )
Limits the amount of time a document can be kept "fresh" in the cache. The MaxFreshPeriod is specified in minutes, and the default value is 525600 which is equal to 1 year.
# Returns a unsigned int
get_MaxResponseSize( )
# n is a unsigned int (input)
put_MaxResponseSize( n )
The maximum HTTP response size to be accepted by the calling program. A value of 0 (the default) indicates that there is no maximum value.
# Returns an integer value
get_MaxUrlLen( )
# n is an integer (input)
put_MaxUrlLen( n )
The Http class will automatically fail any URL longer than this length. The default MaxUrlLen is 800 characters.
# Returns a boolean value
get_MimicFireFox( )
# b is a boolean (input)
put_MimicFireFox( b )
If set to 1, then the appropriate headers to mimic Mozilla/FireFox are automatically added to requests sent via the QuickGet and QuickGetStr methods.
# Returns a boolean value
get_MimicIE( )
# b is a boolean (input)
put_MimicIE( b )
If set to 1, then the appropriate headers to mimic Internet Explorer are automatically added to requests sent via the QuickGet and QuickGetStr methods.
# Returns an integer value
get_MinFreshPeriod( )
# numMinutes is an integer (input)
put_MinFreshPeriod( numMinutes )
The freshness period for a document in cache will not be less than this value (in minutes). The default value is 30.
# Returns a boolean value
get_NegotiateAuth( )
# newVal is a boolean (input)
put_NegotiateAuth( newVal )
Set this property equal to 1 for Negotiate authentication. Negotiate authentication will dynamically select Kerberos or NTLM authentication depending on what the server requires.
Note: The NegotiateAuth property is only available for the Microsoft Windows operating system.
HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)
# Returns a boolean value
get_NtlmAuth( )
# b is a boolean (input)
put_NtlmAuth( b )
Setting this property to 1 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 0.
HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)
# Returns an integer value
get_NumCacheLevels( )
# v is an integer (input)
put_NumCacheLevels( v )
The number of directory levels to be used under each cache root. The default is 0, meaning that each cached HTML page is stored in a cache root directory. A value of 1 causes each cached page to be stored in one of 255 subdirectories named "0","1", "2", ..."255" under a cache root. A value of 2 causes two levels of subdirectories ("0..255/0..255") under each cache root. The HTTP control automatically creates subdirectories as needed. The reason for mutliple levels is to alleviate problems that may arise with unrelated software when huge numbers of files are stored in a single directory. For example, Windows Explorer does not behave well when trying to display the contents of directories with thousands of files.
# Returns an integer value
get_NumCacheRoots( )
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.
# Returns a boolean value
get_OAuth1( )
# newVal is a boolean (input)
put_OAuth1( newVal )
If 1 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.
# str is a CkString (output)
get_OAuthConsumerKey( str )
# newVal is a string (input)
put_OAuthConsumerKey( newVal )
The OAuth consumer key to be used in the Authorization header.
# str is a CkString (output)
get_OAuthRealm( str )
# newVal is a string (input)
put_OAuthRealm( newVal )
The OAuth realm to be used in the Authorization header.
# str is a CkString (output)
get_OAuthSigMethod( str )
# newVal is a string (input)
put_OAuthSigMethod( newVal )
The OAuth signature method, such as "HMAC-SHA1" to be used in the Authorization header. The "HMAC-SHA1" value is currently the only supported signature method.
# str is a CkString (output)
get_OAuthToken( str )
# newVal is a string (input)
put_OAuthToken( newVal )
The OAuth token to be used in the Authorization header.
Twitter OAuth -- Tweet to Your Own Account
# str is a CkString (output)
get_OAuthTokenSecret( str )
# newVal is a string (input)
put_OAuthTokenSecret( newVal )
The OAuth token secret to be used in computing the Authorization header.
# str is a CkString (output)
get_OAuthVerifier( str )
# newVal is a string (input)
put_OAuthVerifier( newVal )
The OAuth verifier to be used in the Authorization header.
# str is a CkString (output)
get_Password( str )
# v is a string (input)
put_Password( v )
The HTTP password for pages requiring a login/password. Chilkat HTTP can do both Basic and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use NTLM, set the NtlmAuth property = 1.
# str is a CkString (output)
get_ProxyAuthMethod( str )
# newVal is a string (input)
put_ProxyAuthMethod( newVal )
Set this to "basic" if you know in advance that Basic authentication is to be used for the HTTP proxy. Otherwise leave this property unset. Note: It is not necessary to set this property. The HTTP component will automatically handle proxy authentication for any of the supported authentication methods: NTLM, Digest, or Basic. Setting this property equal to "basic" prevents the 407 response which is automatically handled internal to Chilkat and never seen by your application.
# str is a CkString (output)
get_ProxyDomain( str )
# v is a string (input)
put_ProxyDomain( v )
The domain name of a proxy host if an HTTP proxy is used.
# str is a CkString (output)
get_ProxyLogin( str )
# newVal is a string (input)
put_ProxyLogin( newVal )
If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy login.
# str is a CkString (output)
get_ProxyLoginDomain( str )
# newVal is a string (input)
put_ProxyLoginDomain( newVal )
The NTLM authentication domain (optional) if NTLM authentication is used.
# str is a CkString (output)
get_ProxyPassword( str )
# newVal is a string (input)
put_ProxyPassword( newVal )
If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy password.
# Returns an integer value
get_ProxyPort( )
# n is an integer (input)
put_ProxyPort( n )
The port number of a proxy server if an HTTP proxy is used.
# Returns an integer value
get_ReadTimeout( )
# numSeconds is an integer (input)
put_ReadTimeout( numSeconds )
The amount of time in seconds to wait before timing out when reading from an HTTP server. The ReadTimeout is the amount of time that needs to elapse while no additional data is forthcoming. During a long download, if the data stream halts for more than this amount, it will timeout. Otherwise, there is no limit on the length of time for the entire download.
# str is a CkString (output)
get_RedirectVerb( str )
# newVal is a string (input)
put_RedirectVerb( newVal )
Indicates the HTTP verb, such as GET, POST, PUT, etc. to be used for a redirect when the FollowRedirects property is set to 1. The default value is an empty string, indicating that the same verb as the original HTTP request should be used.
# str is a CkString (output)
get_Referer( str )
# v is a string (input)
put_Referer( v )
The Referer header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is the empty string which causes the Referer field to be omitted from the request header.
# str is a CkString (output)
get_RequiredContentType( str )
# newVal is a string (input)
put_RequiredContentType( newVal )
If set, then any HTTP response to any POST or GET, including downloads, will be rejected if the content-type in the response header does not match this setting. If the content-type does not match, only the header of the HTTP response is read, the connection to the HTTP server is closed, and the remainder of the response is never read.
This property is empty (zero-length string) by default.
Some typical content-types are "text/html", "text/xml", "image/gif", "image/jpeg", "application/zip", "application/msword", "application/pdf", etc.
# Returns a boolean value
get_S3Ssl( )
# newVal is a boolean (input)
put_S3Ssl( newVal )
If 1, then all S3_* methods will use a secure SSL/TLS connection for communications. The default value is 0.
# Returns a boolean value
get_SaveCookies( )
# b is a boolean (input)
put_SaveCookies( b )
If this property is 1, 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.
# Returns an integer value
get_SendBufferSize( )
# newVal is an integer (input)
put_SendBufferSize( newVal )
The buffer size to be used with the underlying TCP/IP socket for sending. The default value is 65535.
# Returns a boolean value
get_SendCookies( )
# b is a boolean (input)
put_SendCookies( b )
If 1, then cookies previously persisted to the CookiesDir are automatically added to all HTTP requests. Only cookies matching the domain and path are added.
# str is a CkString (output)
get_SessionLogFilename( str )
# newVal is a string (input)
put_SessionLogFilename( newVal )
Enables file-based session logging. If set to a filename (or relative/absolute filepath), then the exact HTTP requests and responses are logged to a file. The file is created if it does not already exist, otherwise it is appended.
# Returns an integer value
get_SoRcvBuf( )
# newVal is an integer (input)
put_SoRcvBuf( newVal )
Sets the receive buffer size socket option. Normally, this property should be left unchanged. The default value is 0, which indicates that the receive buffer size socket option should not be explicitly set (i.e. the system default value, which may vary from system to system, should be used).
This property can be changed if download performance seems slow. It is recommended to be a multiple of 4096. To see the current system's default receive buffer size, examine the LastErrorText property after calling any method that establishes a connection. It should be reported under the heading "SO_RCVBUF". To boost performance, try setting it equal to 2, 3, or 4 times the default value.
# Returns an integer value
get_SoSndBuf( )
# newVal is an integer (input)
put_SoSndBuf( newVal )
Sets the send buffer size socket option. Normally, this property should be left unchanged. The default value is 0, which indicates that the send buffer size socket option should not be explicitly set (i.e. the system default value, which may vary from system to system, should be used).
This property can be changed if upload performance seems slow. It is recommended to be a multiple of 4096. To see the current system's default send buffer size, examine the LastErrorText property after calling any method that establishes a connection. It should be reported under the heading "SO_SNDBUF". To boost performance, try setting it equal to 2, 3, or 4 times the default value.
Note: This property only applies to FTP data connections. The FTP control connection is not used for uploading or downloading files, and is therefore not performance sensitive.
# str is a CkString (output)
get_SocksHostname( str )
# newVal is a string (input)
put_SocksHostname( newVal )
The SOCKS4/SOCKS5 hostname or IPv4 address (in dotted decimal notation). This property is only used if the SocksVersion property is set to 4 or 5).
# str is a CkString (output)
get_SocksPassword( str )
# newVal is a string (input)
put_SocksPassword( newVal )
The SOCKS5 password (if required). The SOCKS4 protocol does not include the use of a password, so this does not apply to SOCKS4.
# Returns an integer value
get_SocksPort( )
# newVal is an integer (input)
put_SocksPort( newVal )
The SOCKS4/SOCKS5 proxy port. The default value is 1080. This property only applies if a SOCKS proxy is used (if the SocksVersion property is set to 4 or 5).
# str is a CkString (output)
get_SocksUsername( str )
# newVal is a string (input)
put_SocksUsername( newVal )
The SOCKS4/SOCKS5 proxy username. This property is only used if the SocksVersion property is set to 4 or 5).
# Returns an integer value
get_SocksVersion( )
# newVal is an integer (input)
put_SocksVersion( newVal )
SocksVersion May be set to one of the following integer values:
0 - No SOCKS proxy is used. This is the default.
4 - Connect via a SOCKS4 proxy.
5 - Connect via a SOCKS5 proxy.
# str is a CkString (output)
get_SslProtocol( str )
# newVal is a string (input)
put_SslProtocol( newVal )
Selects the secure protocol to be used for secure (SSL) connections. Possible values are:
defaultThe default value is "default", which allows for the protocol to be selected dynamically at runtime based on the requirements of the server.
TLS 1.0
SSL 3.0
SSL 2.0
PCT 1.0
# Returns a boolean value
get_UpdateCache( )
# b is a boolean (input)
put_UpdateCache( b )
Controls whether the cache is automatically updated with the responses from HTTP GET requests.
# Returns a boolean value
get_UseBgThread( )
# newVal is a boolean (input)
put_UseBgThread( newVal )
If 1, then background-enabled methods will run in a background thread. Normally, a method will return after its work is completed. However, when UseBgThread is true, the method will return immediately and a background thread is started to carry out the method’s task.
Background-enabled HTTP methods are:
- Download
- DownloadAppend
- GetHead
- PostBinary
- PostMime
- PostUrlEncoded
- PostXml
- PutText
- QuickDeleteStr
- QuickGet
- QuickGetObj
- QuickGetStr
- QuickPutStr
- ResumeDownload
- SynchronousRequest
- XmlRpc
- XmlRpcPut
More information on background enabling HTTP communications.
# Returns a boolean value
get_UseIEProxy( )
# b is a boolean (input)
put_UseIEProxy( b )
If 1, the proxy host/port used by Internet Explorer will also be used by Chilkat HTTP.
# str is a CkString (output)
get_UserAgent( str )
# v is a string (input)
put_UserAgent( v )
The UserAgent header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "Chilkat/1.0.0 (+http://www.chilkatsoft.com/ChilkatHttpUA.asp)" which indicates that the software used to issue the HTTP request was the Chilkat HTTP component.
# Returns a boolean value
get_Utf8( )
# b is a boolean (input)
put_Utf8( b )
When set to 1, all "const char *" arguments are interpreted as utf-8 strings. If set to 0 (the default), then "const char *" arguments are interpreted as ANSI strings. Also, when set to 1, and Chilkat method returning a "const char *" is returning the utf-8 representation. If set to 0, all "const char *" return values are ANSI strings.
# Returns a boolean value
get_VerboseLogging( )
# newVal is a boolean (input)
put_VerboseLogging( newVal )
If set to 1, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is 0. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.
# str is a CkString (output)
get_Version( str )
Returns a string such as "1.0.0" indicating the version of the HTTP component.
# Returns a boolean value
get_WasRedirected( )
Indicates whether the last HTTP GET was redirected.
Methods
# dir is a string (input)
AddCacheRoot( dir )
This method must be called at least once if disk caching is to be used. The file path (including drive letter) such as "E:\MyHttpCache\" is passed to AddCacheRoot to specify the root directory. The cache can be spread across multiple disk drives by calling AddCacheRoot multiple times, each with a directory path on a separate disk drive.
# headerFieldName is a string (input)
# headerFieldValue is a string (input)
# Returns a boolean value
AddQuickHeader( headerFieldName, headerFieldValue )
Adds a custom header field to any HTTP request sent by a method that does not use the HTTP request object. These methods include Download, DownloadAppend, GetHead, PostBinary, PostMime, PostXml, PutBinary, PutText, QuickDeleteStr, QuickGet, QuickGetObj, QuickGetStr, QuickPutStr, XmlRpc, and XmlRpcPut.
Cookies may be explictly added by calling this method passing "Cookie" for the headerFieldName.
The RemoveQuickHeader method can be called to remove a custom header.
* Note: This method is deprecated. It is identical to theSetRequestHeader method. The SetRequestHeader method should be called instead because AddQuickHeader will be removed in a future version.
# Returns a CkHttpResponse
BgResponseObject( )
If a backgrounded method returns an Http response object, it may be retrieved by calling this method.
Call this to force the currently running backgrounded method to abort.
Clears the in-memory event log (which is enabled by setting the KeepEventLog property = 1).
Clears all cookies cached in memory. Calling this only makes sense if the CookieDir property is set to the string "memory".
# Returns a boolean value
CloseAllConnections( )
Closes all connections still open from previous HTTP requests.
An HTTP object instance will maintain up to 10 connections. If the HTTP server's response does not include a "Connection: Close" header, the connection will remain open and will be re-used if possible for the next HTTP request to the same hostname:port. (It uses the IP address (in string form) or the domain name, whichever is used in the URL provided by the application.) If 10 connections are already open and another is needed, the object will close the least recently used connection.
# url is a string (input)
# localFilePath is a string (input)
# Returns a boolean value
Download( url, localFilePath )
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 1 for success, 0 for failure.
# url is a string (input)
# filename is a string (input)
# Returns a boolean value
DownloadAppend( url, filename )
Same as the Download method, but the output file is open for append.
Returns 1 for success, 0 for failure.
# url is a string (input)
# hashAlgorithm is a string (input)
# encoding is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
DownloadHash( url, hashAlgorithm, encoding, outStr )
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 1 for success, 0 for failure.
# index is an integer (input)
# outStr is a CkString (output)
# Returns a boolean value
EventLogName( index, outStr )
Returns the name of the Nth event in the in-memory event log. Refer to the documentation for the KeepEventLog property for the full list of event names. Indexing is from 0 to EventLogCount-1.
Returns 1 for success, 0 for failure.
# index is an integer (input)
# outStr is a CkString (output)
# Returns a boolean value
EventLogValue( index, outStr )
Returns the value of the Nth event in the in-memory event log. Indexing is from 0 to EventLogCount-1.
Returns 1 for success, 0 for failure.
# htmlContent is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
ExtractMetaRefreshUrl( htmlContent, outStr )
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 1 for success, 0 for failure.
# outStr is a CkString (output)
GenTimeStamp( outStr )
Returns the current GMT (also known as UTC) date/time in a string that is compliant with RFC 2616 format.
Returns 1 for success, 0 for failure.
# index is an integer (input)
# str is a CkString (input)
# Returns a boolean value
GetCacheRoot( index, str )
Returns the Nth cache root (indexing begins at 0). Cache roots are set by calling AddCacheRoot one or more times.
Returns 1 for success, 0 for failure.
# domain is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
GetCookieXml( domain, outStr )
Returns the cookies in XML format for a specific domain. Cookies are only persisted if the SaveCookies property is set to 1. If the CookieDir property is set to the keyword "memory", then cookies are saved in-memory.
Returns 1 for success, 0 for failure.
# url is a string (input)
# str is a CkString (input)
GetDomain( url, str )
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 1 for success, 0 for failure.
# url is a string (input)
# Returns a CkHttpResponse
GetHead( url )
Sends an HTTP HEAD request for a URL and returns a response object.
# name is a string (input)
# str is a CkString (input)
# Returns a boolean value
GetRequestHeader( name, str )
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 1 for success, 0 for failure.
# domain is a string (input)
# port is an integer (input)
# Returns a CkCert
GetServerSslCert( domain, port )
Establishes an SSL/TLS connection with a web server for the purpose of retrieving the server's SSL certificate (public-key only of course...). Nothing is retrieved from the web server. This method simply makes a connection, gets the certificate information, and closes the connection.
# url is a string (input)
# str is a CkString (input)
GetUrlPath( url, str )
Returns the path part of a URL. The syntax of a URL is
:// : @ : / ; ? # . This method returns the "path" part. Returns 1 for success, 0 for failure.
# name is a string (input)
# Returns a boolean value
HasRequestHeader( name )
Returns true if the specified header field is defined such that it will be sent with all GET requests issued by the QuickGet and QuickGetStr methods.
# Returns a boolean value
IsUnlocked( )
Returns true if the Http class has been unlocked. It is necessary to call Http.UnlockComponent before calling any other methods. Passing any string to UnlockComponent will automatically activate a 30-day trial period.
# url is a string (input)
# byteData is a CkByteData (input)
# contentType is a string (input)
# md5 is a boolean (input)
# gzip is a boolean (input)
# outStr is a CkString (output)
# Returns a boolean value
PostBinary( url, byteData, contentType, md5, gzip, outStr )
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 1, 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 1, 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 1 for success, 0 for failure.
# url is a string (input)
# jsonText is a string (input)
# Returns a CkHttpResponse
PostJson( url, jsonText )
A simplified way of sending a JSON POST and receiving the JSON response. The HTTP response is returned in an HTTP response object.
# url is a string (input)
# mime is a string (input)
# Returns a CkHttpResponse
PostMime( url, mime )
Allows the calling application to specify the exact content to be sent in a POST. The HTTP POST is sent and the response is returned as an HTTP response object.
# url is a string (input)
# req is a CkHttpRequest (input)
# Returns a CkHttpResponse
PostUrlEncoded( url, req )
Sends a simple URL encoded POST. The form parameters are sent in the body of the HTTP request in x-www-form-urlencoded format. The content-type is "application/x-www-form-urlencoded".
Duplicating a Simple HTML Form Submission (POST)
# endpointUrl is a string (input)
# xmlContent is a string (input)
# xmlCharset is a string (input)
# Returns a CkHttpResponse
PostXml( endpointUrl, xmlContent, xmlCharset )
A simplified way of posting XML content to a web server. This method is good for making SOAP calls using HTTP POST. The xmlCharset should match the character encoding used in the xmlContent, which is typically "utf-8". The HTTP response is returned in an HTTP response object.
Send XMLHttpRequest and Get Response
# url is a string (input)
# byteData is a CkByteData (input)
# contentType is a string (input)
# md5 is a boolean (input)
# gzip is a boolean (input)
# outStr is a CkString (output)
# Returns a boolean value
PutBinary( url, byteData, contentType, md5, gzip, outStr )
Sends an HTTP PUT request to the url. The body of the HTTP request is byteData. The contentType is a content type such as "image/gif", "application/pdf", etc. If md5 is 1, 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 1, 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 1 for success, 0 for failure.
# url is a string (input)
# textData is a string (input)
# charset is a string (input)
# contentType is a string (input)
# md5 is a boolean (input)
# gzip is a boolean (input)
# outStr is a CkString (output)
# Returns a boolean value
PutText( url, textData, charset, contentType, md5, gzip, outStr )
Sends an HTTP PUT request to the url. The body of the HTTP request is textData. The charset should be set to a charset name such as "iso-8859-1", "windows-1252", "Shift_JIS", "utf-8", etc. The string "ansi" may also be used as a charset name. The contentType is a content type such as "text/plain", "text/xml", etc. If md5 is 1, 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 1, 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 1 for success, 0 for failure.
# url is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
QuickDeleteStr( url, outStr )
Same as QuickGetStr, but uses the HTTP DELETE method instead of the GET method.
Returns 1 for success, 0 for failure.
# url is a string (input)
# data is a CkByteData (input)
# Returns a boolean value
QuickGet( url, data )
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.
# url is a string (input)
# Returns a CkHttpResponse
QuickGetObj( url )
Sends an HTTP GET request for a URL and returns the response object. If the SendCookies property is 1, matching cookies previously persisted to the CookiesDir are automatically included in the request. If the FetchFromCache property is 1, the page could be fetched directly from cache.
# url is a string (input)
# str is a CkString (input)
# Returns a boolean value
QuickGetStr( url, str )
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 1, matching cookies previously persisted to the CookiesDir are automatically included in the request. If the FetchFromCache property is 1, the page could be fetched directly from cache. If the HTTP request fails, a NULL value is returned and error information can be found in the LastErrorText, LastErrorXml, or LastErrorHtml properties.
Returns 1 for success, 0 for failure.
# url is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
QuickPutStr( url, outStr )
Same as QuickGetStr, but uses the HTTP PUT method instead of the GET method.
Returns 1 for success, 0 for failure.
# headerFieldName is a string (input)
# Returns a boolean value
RemoveQuickHeader( headerFieldName )
Removes a header from the internal list of custom header field name/value pairs to be automatically added when HTTP requests are sent via methods that do not use the HTTP request object. (The AddQuickHeader method is called to add custom header fields.)
* 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.
# name is a string (input)
RemoveRequestHeader( name )
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.)
# url is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
RenderGet( url, outStr )
Same as QuickGet, but does not send the HTTP GET. Instead, it builds the HTTP request that would've been sent and returns it.
Returns 1 for success, 0 for failure.
# url is a string (input)
# targetFilename is a string (input)
# Returns a boolean value
ResumeDownload( url, targetFilename )
Same as the Download method, except a failed download may be resumed. The targetFilename is automatically checked and if it exists, the download will resume at the point where it previously failed. ResumeDownload may be called any number of times until the full download is complete.
Returns 1 for success, 0 for failure.
# bucketPath is a string (input)
# Returns a boolean value
S3_CreateBucket( bucketPath )
Creates a new Amazon S3 bucket.
Returns 1 for success, 0 for failure.
# bucketPath is a string (input)
# Returns a boolean value
S3_DeleteBucket( bucketPath )
Deletes an Amazon S3 bucket.
# bucketPath is a string (input)
# objectName is a string (input)
# Returns a boolean value
S3_DeleteObject( bucketPath, objectName )
Deletes a remote file (object) on the Amazon S3 service.
Returns 1 for success, 0 for failure.
# bucketPath is a string (input)
# objectName is a string (input)
# outBytes is a CkByteData (output)
# Returns a boolean value
S3_DownloadBytes( bucketPath, objectName, outBytes )
The same as DownloadFile, except the file data is returned directly in-memory instead of being written to a local file.
# bucketPath is a string (input)
# objectName is a string (input)
# localFilePath is a string (input)
# Returns a boolean value
S3_DownloadFile( bucketPath, objectName, localFilePath )
Downloads a file from the Amazon S3 service.
Returns 1 for success, 0 for failure.
# bucketPath is a string (input)
# objectName is a string (input)
# charset is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
S3_DownloadString( bucketPath, objectName, charset, outStr )
Downloads a text file (object) from the Amazon S3 service directly into a string variable. The charset specifies the character encoding, such as "utf-8", of the remote text object.
Returns 1 for success, 0 for failure.
# bucketPath is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
S3_ListBucketObjects( bucketPath, outStr )
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 1 for success, 0 for failure.
# outStr is a CkString (output)
# Returns a boolean value
S3_ListBuckets( outStr )
Retrieves the XML listing of the buckets for an Amazon S3 account.
Returns 1 for success, 0 for failure.
# contentBytes is a CkByteData (input)
# contentType is a string (input)
# bucketPath is a string (input)
# objectName is a string (input)
# Returns a boolean value
S3_UploadBytes( contentBytes, contentType, bucketPath, objectName )
The same as S3_UploadFile, except the contents of the file come from contentBytes instead of a local file.
Returns 1 for success, 0 for failure.
# localFilePath is a string (input)
# contentType is a string (input)
# bucketPath is a string (input)
# objectName is a string (input)
# Returns a boolean value
S3_UploadFile( localFilePath, contentType, bucketPath, objectName )
Uploads a file to the Amazon S3 service.
Returns 1 for success, 0 for failure.
# objectContent is a string (input)
# charset is a string (input)
# contentType is a string (input)
# bucketPath is a string (input)
# objectName is a string (input)
# Returns a boolean value
S3_UploadString( objectContent, charset, contentType, bucketPath, objectName )
Uploads an in-memory string to the Amazon S3 service. This is the same as UploadFile, except that the file contents are from an in-memory string instead of a local file. Internal to this method, the objectContent is converted to the character encoding specified by charset prior to uploading.
Returns 1 for success, 0 for failure.
# filename is a string (input)
# Returns a boolean value
SaveLastError( filename )
Saves the last-error information (the contents of LastErrorXml) to an XML formatted file.
# domain is a string (input)
# cookieXml is a string (input)
# Returns a boolean value
SetCookieXml( domain, cookieXml )
Restores cookies for a particular domain. It is assumed that the cookie XML was previously retrieved via the GetCookieXml method, and saved to some sort of persistent storage, such as within a database table. It is then possible for an application to restore the cookies by calling this method.
Returns 1 for success, 0 for failure.
# headerFieldName is a string (input)
# headerFieldValue is a string (input)
SetRequestHeader( headerFieldName, headerFieldValue )
Adds a custom header field to any HTTP request sent by a method that does not use the HTTP request object. These methods include Download, DownloadAppend, GetHead, PostBinary, PostMime, PostXml, PutBinary, PutText, QuickDeleteStr, QuickGet, QuickGetObj, QuickGetStr, QuickPutStr, XmlRpc, and XmlRpcPut.
Cookies may be explictly added by calling this method passing "Cookie" for the headerFieldName.
The RemoveRequestHeader method can be called to remove a custom header.
# cert is a CkCert (input)
# Returns a boolean value
SetSslClientCert( cert )
Allows for a client-side certificate to be used for an SSL connection.
# pemDataOrPath is a string (input)
# pemPassword is a string (input)
# Returns a boolean value
SetSslClientCertPem( pemDataOrPath, pemPassword )
Allows for a client-side certificate + private key to be used for the SSL / TLS connection (often called 2-way SSL).
How to Create a PEM that Contains Certificates and a Private Key
# pfxPath is a string (input)
# pfxPassword is a string (input)
# Returns a boolean value
SetSslClientCertPfx( pfxPath, pfxPassword )
Allows for a client-side certificate + private key to be used for the SSL / TLS connection (often called 2-way SSL).
# millisec is an integer (input)
SleepMs( millisec )
Convenience method to force the calling process to sleep for a number of milliseconds.
# domain is a string (input)
# port is an integer (input)
# ssl is a boolean (input)
# req is a CkHttpRequest (input)
# Returns a CkHttpResponse
SynchronousRequest( domain, port, ssl, req )
Sends an explicit HttpRequest to an HTTP server and returns an HttpResponse object. The HttpResponse object provides full access to the response including all headers and the response body. This method may be used to send POST requests, as well as GET, HEAD, file uploads, and XMLHTTP.
How URL Syntax Relates to SynchronousRequest
WebDAV PROPFIND using SynchronousRequest
Send XMLHttpRequest using PUT, GET, DELETE, or any HTTP Request Method
# unlockCode is a string (input)
# Returns a boolean value
UnlockComponent( unlockCode )
Unlocks the Http class/component. It is necessary to call Http.UnlockComponent before calling any other methods. Passing any string to UnlockComponent will automatically activate a 30-day trial period.
Returns 1 for success, 0 for failure.
Diagnosing UnlockComponent Problems
UnlockComponent LastErrorText shows exact string passed to it.
# str is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
UrlDecode( str, outStr )
URL decodes a string.
Returns 1 for success, 0 for failure.
# str is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
UrlEncode( str, outStr )
URL encodes a string.
Returns 1 for success, 0 for failure.
# urlEndpoint is a string (input)
# xmlIn is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
XmlRpc( urlEndpoint, xmlIn, outStr )
Makes an XML RPC call to a URL endpoint. The XML string is passed in an HTTP POST, and the XML response is returned.
Returns 1 for success, 0 for failure.
# urlEndpoint is a string (input)
# xmlIn is a string (input)
# outStr is a CkString (output)
# Returns a boolean value
XmlRpcPut( urlEndpoint, xmlIn, outStr )
Same as XmlRpc, but uses the HTTP PUT method instead of the POST method.
Returns 1 for success, 0 for failure.
# Returns a string
acceptCharset( )
The AcceptCharset header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "ISO-8859-1,utf-8;q=0.7,*;q=0.7".
Returns a null on failure
# Returns a string
acceptLanguage( )
The AcceptLanguage header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "en-us,en;q=0.5".
Returns a null on failure
# Returns a string
awsAccessKey( )
The AWS Access Key to be used with the Amazon S3 methods listed below.
Returns a null on failure
# Returns a string
awsSecretKey( )
The AWS Secret Key to be used with the Amazon S3 methods listed below.
Returns a null on failure
# Returns a string
awsSubResources( )
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.
Returns a null on failure
# Returns a string
bgLastErrorText( )
When a background-enabled method is run asynchronously in a background thread, the last-error information is saved here and not in the LastErrorText property. If the background method fails, this will contain information about what transpired. (This property also contains information when the background method succeeds.)
Returns a null on failure
More information on background enabling HTTP communications.
# Returns a string
bgResultString( )
If a backgrounded method returns a string, the return value is found here.
Returns a null on failure
# Returns a string
ck_accept( )
To be documented soon...
# Returns a string
clientIpAddress( )
The IP address to use for computers with multiple network interfaces or IP addresses. For computers with a single network interface (i.e. most computers), this property should not be set. For multihoming computers, the default IP address is automatically used if this property is not set.
The IP address is a string such as in dotted notation using numbers, not domain names, such as "165.164.55.124".
Returns a null on failure
# Returns a string
connection( )
The Connection header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "Keep-Alive". To prevent the Connection header from being added to the HTTP header, set this property to the empty string.
Returns a null on failure
# Returns a string
cookieDir( )
Specifies a directory where cookies are automatically persisted if the Http.SaveCookies property is turned on. Cookies are stored in XML formatted files, one per domain, to main it easy for other programs to understand and parse. May be set to the string "memory" to cache cookies in memory.
Returns a null on failure
# Returns a string
debugLogFilePath( )
Used for debugging in cases where a Chilkat method call hangs and never returns. This should generally never happen. The only causes for this are (1) a timeout related property was set to 0 to explicitly indicate that an infinite timeout is desired, (2) the hang is actually a hang within an event callback (i.e. it is a hang within the application code), or (3) there is an internal problem (bug) in the Chilkat code that causes the hang.
This property allows one to specifiy a debug file path that will be created (or appended if it already exists) and information will be logged to it as the Chilkat methods are called. If a hang occurs, the log file may be viewed to get information about what happened.
Returns a null on failure
# url is a string (input)
# hashAlgorithm is a string (input)
# encoding is a string (input)
# Returns a string
downloadHash( url, hashAlgorithm, encoding )
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 a null on failure
# index is an integer (input)
# Returns a string
eventLogName( index )
Returns the name of the Nth event in the in-memory event log. Refer to the documentation for the KeepEventLog property for the full list of event names. Indexing is from 0 to EventLogCount-1.
Returns a null on failure
# index is an integer (input)
# Returns a string
eventLogValue( index )
Returns the value of the Nth event in the in-memory event log. Indexing is from 0 to EventLogCount-1.
Returns a null on failure
# htmlContent is a string (input)
# Returns a string
extractMetaRefreshUrl( htmlContent )
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 a null on failure
# Returns a string
finalRedirectUrl( )
If an HTTP GET was redirected (as indicated by the WasRedirected property), this property will contain the final redirect URL, assuming the FollowRedirects property is true.
Returns a null on failure
# Returns a string
genTimeStamp( )
Returns the current GMT (also known as UTC) date/time in a string that is compliant with RFC 2616 format.
Returns a null on failure
# index is an integer (input)
# Returns a string
getCacheRoot( index )
Returns the Nth cache root (indexing begins at 0). Cache roots are set by calling AddCacheRoot one or more times.
Returns a null on failure
# domain is a string (input)
# Returns a string
getCookieXml( domain )
Returns the cookies in XML format for a specific domain. Cookies are only persisted if the SaveCookies property is set to 1. If the CookieDir property is set to the keyword "memory", then cookies are saved in-memory.
Returns a null on failure
# url is a string (input)
# Returns a string
getDomain( url )
Utility method for extracting the domain name from a full URL. For example, if "http://www.chilkatsoft.com/default.asp" is the URL passed in, then "www.chilkatsoft.com" is returned.
Returns a null on failure
# name is a string (input)
# Returns a string
getRequestHeader( name )
Returns the value of a header field that has been pre-defined to be sent with all HTTP GET requests issued by the QuickGet and QuickGetStr methods. By default, this includes header fields such as Accept, AcceptCharset, AcceptLanguage, Connection, UserAgent, etc.
Returns a null on failure
# url is a string (input)
# Returns a string
getUrlPath( url )
Returns the path part of a URL. The syntax of a URL is
:// : @ : / ; ? # . This method returns the "path" part. Returns a null on failure
# Returns a string
lastContentType( )
The content-type of the last HTTP response received by the HTTP component.
Returns a null on failure
# Returns a string
lastErrorHtml( )
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.
# Returns a string
lastErrorText( )
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.
# Returns a string
lastErrorXml( )
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.
# Returns a string
lastHeader( )
The text of the last HTTP header sent by any of this class's methods. The purpose of this property is to allow the developer to examine the exact HTTP header for debugging purposes.
Returns a null on failure
# Returns a string
lastModDate( )
The value of the Last-Modified header in the last HTTP response received by the HTTP component.
Returns a null on failure
# Returns a string
lastResponseHeader( )
The entire last response header for the last HTTP response received by the HTTP component.
Returns a null on failure
The HTTP login for pages requiring a login/password. Chilkat HTTP can do both Basic and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use NTLM, set the NtlmAuth property = 1.
Returns a null on failure
HTTP Authentication (Basic, NTLM, Digest, Negotiate/Kerberos)
# Returns a string
loginDomain( )
The optional domain name to be used with NTLM / Kerberos / Negotiate authentication.
Returns a null on failure
# Returns a string
oAuthConsumerKey( )
The OAuth consumer key to be used in the Authorization header.
Returns a null on failure
# Returns a string
oAuthRealm( )
The OAuth realm to be used in the Authorization header.
Returns a null on failure
# Returns a string
oAuthSigMethod( )
The OAuth signature method, such as "HMAC-SHA1" to be used in the Authorization header. The "HMAC-SHA1" value is currently the only supported signature method.
Returns a null on failure
# Returns a string
oAuthToken( )
The OAuth token to be used in the Authorization header.
Returns a null on failure
Twitter OAuth -- Tweet to Your Own Account
# Returns a string
oAuthTokenSecret( )
The OAuth token secret to be used in computing the Authorization header.
Returns a null on failure
# Returns a string
oAuthVerifier( )
The OAuth verifier to be used in the Authorization header.
Returns a null on failure
The HTTP password for pages requiring a login/password. Chilkat HTTP can do both Basic and NTLM HTTP authentication. (NTLM is also known as SPA (or Windows Integrated Authentication). To use NTLM, set the NtlmAuth property = 1.
Returns a null on failure
# url is a string (input)
# byteData is a CkByteData (input)
# contentType is a string (input)
# md5 is a boolean (input)
# gzip is a boolean (input)
# Returns a string
postBinary( url, byteData, contentType, md5, gzip )
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 1, 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 1, the byteData is compressed using the gzip algorithm. The HTTP request body will contain the GZIP compressed data, and a "Content-Encoding: gzip" header is automatically added to indicate that the request data needs to be ungzipped when received (at the server).
Returns a null on failure
# Returns a string
proxyAuthMethod( )
Set this to "basic" if you know in advance that Basic authentication is to be used for the HTTP proxy. Otherwise leave this property unset. Note: It is not necessary to set this property. The HTTP component will automatically handle proxy authentication for any of the supported authentication methods: NTLM, Digest, or Basic. Setting this property equal to "basic" prevents the 407 response which is automatically handled internal to Chilkat and never seen by your application.
Returns a null on failure
# Returns a string
proxyDomain( )
The domain name of a proxy host if an HTTP proxy is used.
Returns a null on failure
# Returns a string
proxyLogin( )
If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy login.
Returns a null on failure
# Returns a string
proxyLoginDomain( )
The NTLM authentication domain (optional) if NTLM authentication is used.
Returns a null on failure
# Returns a string
proxyPassword( )
If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy password.
Returns a null on failure
# url is a string (input)
# byteData is a CkByteData (input)
# contentType is a string (input)
# md5 is a boolean (input)
# gzip is a boolean (input)
# Returns a string
putBinary( url, byteData, contentType, md5, gzip )
Sends an HTTP PUT request to the url. The body of the HTTP request is byteData. The contentType is a content type such as "image/gif", "application/pdf", etc. If md5 is 1, 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 1, the byteData is compressed using the gzip algorithm. The HTTP request body will contain the GZIP compressed data, and a "Content-Encoding: gzip" header is automatically added to indicate that the request data needs to be ungzipped when received (at the server).
Returns a null on failure
# url is a string (input)
# textData is a string (input)
# charset is a string (input)
# contentType is a string (input)
# md5 is a boolean (input)
# gzip is a boolean (input)
# Returns a string
putText( url, textData, charset, contentType, md5, gzip )
Sends an HTTP PUT request to the url. The body of the HTTP request is textData. The charset should be set to a charset name such as "iso-8859-1", "windows-1252", "Shift_JIS", "utf-8", etc. The string "ansi" may also be used as a charset name. The contentType is a content type such as "text/plain", "text/xml", etc. If md5 is 1, 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 1, the textData is compressed using the gzip algorithm. The HTTP request body will contain the GZIP compressed data, and a "Content-Encoding: gzip" header is automatically added to indicate that the request data needs to be ungzipped when received (at the server).
Returns a null on failure
# url is a string (input)
# Returns a string
quickDeleteStr( url )
Same as QuickGetStr, but uses the HTTP DELETE method instead of the GET method.
Returns a null on failure
# url is a string (input)
# Returns a string
quickGetStr( url )
Sends an HTTP GET request for a URL and returns the response body as a string. The URL may contain query parameters. If the SendCookies property is 1, matching cookies previously persisted to the CookiesDir are automatically included in the request. If the FetchFromCache property is 1, the page could be fetched directly from cache. If the HTTP request fails, a NULL value is returned and error information can be found in the LastErrorText, LastErrorXml, or LastErrorHtml properties.
Returns a null on failure
# url is a string (input)
# Returns a string
quickPutStr( url )
Same as QuickGetStr, but uses the HTTP PUT method instead of the GET method.
Returns a null on failure
# Returns a string
redirectVerb( )
Indicates the HTTP verb, such as GET, POST, PUT, etc. to be used for a redirect when the FollowRedirects property is set to 1. The default value is an empty string, indicating that the same verb as the original HTTP request should be used.
Returns a null on failure
The Referer header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is the empty string which causes the Referer field to be omitted from the request header.
Returns a null on failure
# url is a string (input)
# Returns a string
renderGet( url )
Same as QuickGet, but does not send the HTTP GET. Instead, it builds the HTTP request that would've been sent and returns it.
Returns a null on failure
# Returns a string
requiredContentType( )
If set, then any HTTP response to any POST or GET, including downloads, will be rejected if the content-type in the response header does not match this setting. If the content-type does not match, only the header of the HTTP response is read, the connection to the HTTP server is closed, and the remainder of the response is never read.
This property is empty (zero-length string) by default.
Some typical content-types are "text/html", "text/xml", "image/gif", "image/jpeg", "application/zip", "application/msword", "application/pdf", etc.
Returns a null on failure
# bucketPath is a string (input)
# objectName is a string (input)
# charset is a string (input)
# Returns a string
s3_DownloadString( bucketPath, objectName, charset )
Downloads a text file (object) from the Amazon S3 service directly into a string variable. The charset specifies the character encoding, such as "utf-8", of the remote text object.
Returns a null on failure
# bucketPath is a string (input)
# Returns a string
s3_ListBucketObjects( bucketPath )
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 a null on failure
# Returns a string
s3_ListBuckets( )
Retrieves the XML listing of the buckets for an Amazon S3 account.
Returns a null on failure
# Returns a string
sessionLogFilename( )
Enables file-based session logging. If set to a filename (or relative/absolute filepath), then the exact HTTP requests and responses are logged to a file. The file is created if it does not already exist, otherwise it is appended.
Returns a null on failure
# Returns a string
socksHostname( )
The SOCKS4/SOCKS5 hostname or IPv4 address (in dotted decimal notation). This property is only used if the SocksVersion property is set to 4 or 5).
Returns a null on failure
# Returns a string
socksPassword( )
The SOCKS5 password (if required). The SOCKS4 protocol does not include the use of a password, so this does not apply to SOCKS4.
Returns a null on failure
# Returns a string
socksUsername( )
The SOCKS4/SOCKS5 proxy username. This property is only used if the SocksVersion property is set to 4 or 5).
Returns a null on failure
# Returns a string
sslProtocol( )
Selects the secure protocol to be used for secure (SSL) connections. Possible values are:
defaultThe default value is "default", which allows for the protocol to be selected dynamically at runtime based on the requirements of the server.
TLS 1.0
SSL 3.0
SSL 2.0
PCT 1.0
Returns a null on failure
# str is a string (input)
# Returns a string
urlDecode( str )
URL decodes a string.
Returns a null on failure
# str is a string (input)
# Returns a string
urlEncode( str )
URL encodes a string.
Returns a null on failure
# Returns a string
userAgent( )
The UserAgent header field to be automatically included with GET requests issued by QuickGet or QuickGetStr. The default value is "Chilkat/1.0.0 (+http://www.chilkatsoft.com/ChilkatHttpUA.asp)" which indicates that the software used to issue the HTTP request was the Chilkat HTTP component.
Returns a null on failure
Returns a string such as "1.0.0" indicating the version of the HTTP component.
Returns a null on failure
# urlEndpoint is a string (input)
# xmlIn is a string (input)
# Returns a string
xmlRpc( urlEndpoint, xmlIn )
Makes an XML RPC call to a URL endpoint. The XML string is passed in an HTTP POST, and the XML response is returned.
Returns a null on failure
# urlEndpoint is a string (input)
# xmlIn is a string (input)
# Returns a string
xmlRpcPut( urlEndpoint, xmlIn )
Same as XmlRpc, but uses the HTTP PUT method instead of the POST method.
Returns a null on failure