Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

HTTP POST x-www-form-urlencoded

Demonstrates how to send a simple URL encoded POST (content-type = x-www-form-urlencoded). Form params are passed in the HTTP request body in x-www-form-urlencoded format.

Download Chilkat C/C++ Libraries for VC++ 10.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 10.0 / x64

Download Chilkat C/C++ Libraries for VC++ 9.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 9.0 / x64

Download Chilkat C/C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C/C++ 64-bit Libraries for VC++ 8.0 / x64

Download Chilkat Visual Studio 2005 C/C++ Libs for Windows Mobile, Pocket PC, SmartPhone, WinCE

Download Chilkat C/C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0, Win 95/98/NT4 Compatible

#include <CkHttp.h>
#include <CkHttpRequest.h>
#include <CkHttpResponse.h>

void ChilkatSample(void)
    {
    CkHttp http;

    bool success;

    //  Any string unlocks the component for the 1st 30-days.
    success = http.UnlockComponent("Anything for 30-day trial");
    if (success != true) {
        printf("%s\n",http.lastErrorText());
        return;
    }

    CkHttpRequest req;

    //  Add the request params expected by the server-side:
    req.AddParam("city","Paris");
    req.AddParam("country","France");

    //  Send the POST  (This is a real URL that may be tested.)
    CkHttpResponse *resp = 0;
    resp = http.PostUrlEncoded("http://www.chilkatsoft.com/httpTest/cityCountry.asp",req);
    if (resp == 0 ) {
        printf("%s\n",http.lastErrorText());
        return;
    }

    delete resp;

    //  The exact HTTP request sent and response received
    //  by the example code above is as follows:

    //  
---- Sending ----
POST /httpTest/cityCountry.asp HTTP/1.1
Host: www.chilkatsoft.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 25

city=Paris&country=France
---- Received ----
HTTP/1.1 200 OK
Date: Wed, 09 Dec 2009 16:16:00 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Length: 156
Content-Type: text/html
Set-Cookie: ASPSESSIONIDQCDTSSAC=MHJCNFMDENFOKGINOFEDILCM; path=/
Cache-control: private


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>

France<br />Paris<br />

</body>
</html>

    }

Need a specific example? Send a request to support@chilkatsoft.com

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

Mail Component · .NET Mail Component · XML Parser