Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Lianja Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
FileAccess
Firebase
GMail REST API
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Sheets
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)

Java KeyStore (JKS)
Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
Upload
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(Lianja) HTTP HEAD Request

Sends an HTTP HEAD request and gets the response.

Note: The response to an HTTP HEAD request is always just the response header. The reponse body is always 0 length (thus the reason it's called a "HEAD" request..)

Chilkat Lianja Extension Download

Chilkat Lianja Extension

loHttp = createobject("CkHttp")

//  Any string unlocks the component for the 1st 30 days.
llSuccess = loHttp.UnlockComponent("Anything for 30-day trial")
if (llSuccess <> .T.) then
    ? loHttp.LastErrorText
    release loHttp
    return
endif

//  If the URL uses "https://", then the connection will be TLS.
//  Otherwise it will be TCP.
loResponse = loHttp.GetHead("https://example-code.com/")
if (loHttp.LastMethodSuccess <> .T.) then
    //  A failure is when we don't get any response.  It could be a timeout, an inability to connect, etc.
    //  For example, a "404 Not Found" response is still a response, and thus deemed success in terms of the API..
    ? loHttp.LastErrorText
    release loHttp
    return
endif

//  Examine the response.
? "Status Code = " + str(loResponse.StatusCode)
? "Status Line = " + loResponse.StatusLine
? "Status Text = " + loResponse.StatusText
? "Full Response Header:"
? loResponse.Header
? "----"
lnNumHeaderFields = loResponse.NumHeaderFields
? "Num Header Fields: " + str(lnNumHeaderFields)

for i = 0 to lnNumHeaderFields - 1
    ? loResponse.GetHeaderName(i) + ": " + loResponse.GetHeaderValue(i)
next

release loResponse


release loHttp

 

© 2000-2019 Chilkat Software, Inc. All Rights Reserved.