FoxPro Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
Socket
Spider
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Amazon S3
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

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

Demonstrates how to use HTTP authentication. Authentication can be added to any method that sends an HTTP request to the server, such as SynchronousRequest, QuickGetStr, PostXml, etc. To add authentication, simply set the Login and Password properties.

By default, Chilkat will use basic HTTP authentication, which sends the login/password clear-text over the connection. This is bad if SSL/TLS (i.e. HTTPS) is not used. However, if the connection is secure, there should be nothing wrong with using basic authentication.

Chilkat supports more secure authentication types as well, including Digest, NTLM, and Negotiate (which dynamically chooses between NTLM and Kerberos). To use Digest authentication, simply set the DigestAuth property = 1. To use NTLM authentication, set the NtlmAuth property = 1. Likewise, to use Negotiate authentication, set the NegotiateAuth property = 1.

Important: Negotiate authentication is only supported for the Chilkat implementations that run on the Windows platform. This is because it is implemented internally using Microsoft's SSPI API. NTLM authentication however, is available for all supported operating systems because Chilkat implements NTLM directlly (i.e. does not use Microsoft SSPI for the underlying implementation.)

Download Chilkat HTTP ActiveX

LOCAL loHttp
LOCAL lnSuccess
LOCAL lcHtml
LOCAL loHttp2
LOCAL loHttp3

loHttp = CreateObject('Chilkat.Http')

*  Any string unlocks the component for the 1st 30-days.
lnSuccess = loHttp.UnlockComponent("Anything for 30-day trial")
IF (lnSuccess <> 1) THEN
    ? loHttp.LastErrorText
    QUIT
ENDIF

*  Set the Login and Password properties for authentication.
loHttp.Login = "chilkat"
loHttp.Password = "myPassword"

lcHtml = loHttp.QuickGetStr("http://localhost/xyz.html")
*  Note:
IF (lcHtml = NULL ) THEN
    ? loHttp.LastErrorText
    QUIT
ENDIF

*  Examine the HTTP status code returned.
*  A status code of 401 is typically returned for "access denied"
*  if no login/password is provided, or if the credentials (login/password)
*  are incorrect.
? "HTTP status code for Basic authentication: " + loHttp.LastStatus

*  Examine the HTML returned for the URL:
? lcHtml

loHttp2 = CreateObject('Chilkat.Http')

*  To use NTLM authentication, set the
*  NtlmAuth property = 1
loHttp2.NtlmAuth = 1

*  The session log can be captured to a file by
*  setting the SessionLogFilename property:
loHttp2.SessionLogFilename = "ntlmAuthLog.txt"

*  Examination of the HTTP session log will show the NTLM
*  back-and-forth exchange between the client and server.

*  This call will now use NTLM authentication (assuming it
*  is supported by the web server).
lcHtml = loHttp2.QuickGetStr("http://localhost/xyz.html")
*  Note:
IF (lcHtml = NULL ) THEN
    ? loHttp2.LastErrorText
    QUIT
ENDIF

? "HTTP status code for NTLM authentication: " + loHttp2.LastStatus

loHttp3 = CreateObject('Chilkat.Http')

*  To use Digest Authentication, set the DigestAuth property = 1
*  Also, no more than one of the authentication type properties
*  (NtlmAuth, DigestAuth, and NegotiateAuth)  should be set
*  to 1.
loHttp3.DigestAuth = 1

loHttp3.SessionLogFilename = "digestAuthLog.txt"

*  This call will now use Digest authentication (assuming it
*  is supported by the web server).
lcHtml = loHttp3.QuickGetStr("http://localhost/xyz.html")
*  Note:
IF (lcHtml = NULL ) THEN
    ? loHttp3.LastErrorText
    QUIT
ENDIF

? "HTTP status code for Digest authentication: " + loHttp3.LastStatus

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

Mail Component · .NET Email Component · ASP Mail Component · XML Parser