Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.js

Visual Basic 6.0 Examples

Async
Certificates
ECC
Email Object
Encryption
FTP
HTML-to-XML/Text
Gzip
HTTP
IMAP
JSON
MHT / HTML Email
PEM
PFX/P12
Java KeyStore (JKS)
POP3
RSA Encryption
MIME
REST
SCP
SMTP
Socket/SSL/TLS
SSH Key
SSH
SFTP
Stream
Tar Archive
XML
XMP
Zip

More Examples...
Google APIs
Google Cloud Storage
Azure Cloud Storage
Amazon S3 (new)
Google Drive
ASN.1
PRNG
Amazon S3
Bounced Email
CSV
Diffie-Hellman
DKIM / DomainKey
DSA
NTLM
QuickBooks

 

 

 

 

 

 

 

(Visual Basic 6.0) HTTP POST JSON (application/json)

Demonstrates how to send a JSON POST using the application/json content-type.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Dim req As New ChilkatHttpRequest
Dim http As New ChilkatHttp

Dim success As Long

'  Any string unlocks the component for the 1st 30 days.
success = http.UnlockComponent("Anything for 30-day trial")
If (success <> 1) Then
    Text1.Text = Text1.Text & http.LastErrorText & vbCrLf
    Exit Sub
End If

'  If any custom headers need to be included with the POST, add them
'  by calling SetRequestHeader

'  Note: An application should never explicitly set the Content-Length header.
'  The Content-Length is automatically computed and added by Chilkat.

'  Here are some examples of custom headers.

'  Perhaps your particular app needs some sort of custom-computed Authorization header...
http.SetRequestHeader "Authorization","my-custom-computed-auth-value"

'  Another custom header for some hypothetical app:
http.SetRequestHeader "X-Pass-Timestamp","my-custom-computed-timestamp-value"

'  We don't need to set the Content-Type header, becaue it is automatically set by Chilkat
'  in the PostJson2 call below.

'  The following "Accept" header may be set, but it really isn't necessary:
http.SetRequestHeader "Accept","application/json"

Dim jsonText As String
jsonText = "{ some JSON text ... }"

'  To use SSL/TLS, simply use "https://" in the URL.

Dim resp As ChilkatHttpResponse
Set resp = http.PostJson2("http://www.someserver.com/someJsonEndpoint","application/json",jsonText)
If (resp Is Nothing ) Then
    Text1.Text = Text1.Text & http.LastErrorText & vbCrLf
Else
    '  Display the JSON response.
    Text1.Text = Text1.Text & resp.BodyStr & vbCrLf

End If


 

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