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) Simple REST Example (dev.markitondemand.com)

Demonstrates a very simple RESTful API call to get a stock quote from Markit On Demand.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

'  This example requires the Chilkat API to have been previously unlocked.
'  See Global Unlock Sample for sample code.

Dim rest As New ChilkatRest

'  Connect to the REST server.
Dim bTls As Long
bTls = 0
Dim port As Long
port = 80
Dim bAutoReconnect As Long
bAutoReconnect = 1
Dim success As Long
success = rest.Connect("dev.markitondemand.com",port,bTls,bAutoReconnect)

'  Get a stock quote:
success = rest.AddQueryParam("symbol","AAPL")
Dim responseXml As String
responseXml = rest.FullRequestNoBody("GET","/MODApis/Api/v2/Quote")
If (rest.LastMethodSuccess <> 1) Then
    Text1.Text = Text1.Text & rest.LastErrorText & vbCrLf
    Exit Sub
End If

'  If successful, XML such as shown below is returned.
Dim xml As New ChilkatXml
success = xml.LoadXml(responseXml)

'  Get the LastPrice
Text1.Text = Text1.Text & "LastPrice: " & xml.GetChildContent("LastPrice") & vbCrLf

'  Show the full XML response, pretty-formatted
Text1.Text = Text1.Text & xml.GetXml() & vbCrLf


/*

<?xml version="1.0" encoding="utf-8" ?>
<StockQuote>
    <Status>SUCCESS</Status>
    <Name>Apple Inc</Name>
    <Symbol>AAPL</Symbol>
    <LastPrice>94.91</LastPrice>
    <Change>-2.91</Change>
    <ChangePercent>-2.9748517686</ChangePercent>
    <Timestamp>Thu Apr 28 15:17:03 UTC-04:00 2016</Timestamp>
    <MSDate>42488.6368402778</MSDate>
    <MarketCap>526236372530</MarketCap>
    <Volume>4965478</Volume>
    <ChangeYTD>105.26</ChangeYTD>
    <ChangePercentYTD>-9.8327949838</ChangePercentYTD>
    <High>97.88</High>
    <Low>94.88</Low>
    <Open>97.61</Open>
</StockQuote>


*/

 

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