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 POST JSON

Demonstrates how to send a JSON POST and get the JSON response.

Download Chilkat HTTP ActiveX

LOCAL loReq
LOCAL loHttp
LOCAL lnSuccess
LOCAL lcJsonText
LOCAL loResp

loReq = CreateObject('Chilkat.HttpRequest')
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

*  This example duplicates the HTTP POST shown at
*  http://json.org/JSONRequest.html

*  Specifically, the request to be sent looks like this:
*  
POST /request HTTP/1.1
Accept: application/jsonrequest
Content-Encoding: identity
Content-Length: 72
Content-Type: application/jsonrequest
Host: json.penzance.org

{"user":"doctoravatar@penzance.com","forecast":7,"t":"vlIj","zip":94089}
* First, remove default header fields that would be automatically * sent. (These headers are harmless, and shouldn't need to * be suppressed, but just in case...) loHttp.AcceptCharset = "" loHttp.UserAgent = "" loHttp.AcceptLanguage = "" * Suppress the Accept-Encoding header by disallowing * a gzip response: loHttp.AllowGzip = 0 * If a Cookie needs to be added, it may be added by calling * AddQuickHeader: loHttp.AddQuickHeader("Cookie","JSESSIONID=1234") lcJsonText = [{"user":"doctoravatar@penzance.com","forecast":7,"t":"vlIj","zip":94089}] * To use SSL/TLS, simply use "https://" in the URL. * IMPORTANT: Make sure to change the URL, JSON text, * and other data items to your own values. The URL used * in this example will not actually work. loResp = loHttp.PostJson("http://json.penzance.org/request",lcJsonText) IF (loResp = NULL ) THEN ? loHttp.LastErrorText ELSE * Display the JSON response. ? loResp.BodyStr ENDIF

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

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