Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Downloads
.NET 2.0
.NET 1.*
.NET x64
VC++ 6.0
VC++ 7.0
VC++ 8.0
Java
Ruby
Perl 5.8.*
Perl 5.10.*
Python
Bounce ActiveX
Charset ActiveX
Email ActiveX
FTP2 ActiveX
Crypt ActiveX
HTML-to-XML ActiveX
HTTP ActiveX
IMAP ActiveX
MHT ActiveX
MIME ActiveX
RSA ActiveX
Socket ActiveX
Spider ActiveX (free)
String ActiveX (free)
Tar ActiveX
Upload ActiveX (free)
XML ActiveX (free)
XMP ActiveX
Zip ActiveX

Index of Chilkat Blog Posts

February 6, 2008

XMLHttpRequest Examples using Chilkat HTTP

ASP: XMLHTTP / XMLHttpRequest
SQL Server: XMLHTTP / XMLHttpRequest
C#: XMLHTTP / XMLHttpRequest
C++: XMLHTTP / XMLHttpRequest
Delphi: XMLHTTP / XMLHttpRequest
Visual FoxPro: XMLHTTP / XMLHttpRequest
Java: XMLHTTP / XMLHttpRequest
Perl: XMLHTTP / XMLHttpRequest
Python: XMLHTTP / XMLHttpRequest
Ruby: XMLHTTP / XMLHttpRequest
VB.NET: XMLHTTP / XMLHttpRequest
Visual Basic: XMLHTTP / XMLHttpRequest
VBScript: XMLHTTP / XMLHttpRequest

This is the equivalent code in C++ using MSXML2

IXMLHTTPRequestPtr pIXMLHTTPRequest = NULL;
BSTR bstrString = NULL;
HRESULT hr;
	
try {
    hr=pIXMLHTTPRequest.CreateInstance("Msxml2.XMLHTTP.3.0");
    SUCCEEDED(hr) ? 0 : throw hr;
	
    <strong>//  Note: You must first replace the domain and path of this example with real values.
    // There is nothing at http://www.chilkatsoft.com/something.asp</strong>
	
    _bstr_t bstrURL("http://www.chilkatsoft.com/something.asp");
	
    hr=pIXMLHTTPRequest->open("POST", bstrURL, false);
    SUCCEEDED(hr) ? 0 : throw hr;
	
    _bstr_t bstrBody("<test>This is the XML to be sent</test>");
    hr=pIXMLHTTPRequest->send(bstrBody);
	
    SUCCEEDED(hr) ? 0 : throw hr;
    bstrString = pIXMLHTTPRequest->responseText;
	
    if(bstrString)
    {
        // ConvertBSTRToString.cpp
        char* lpszText2 = _com_util::ConvertBSTRToString(bstrString);
        strcpy_s (lpResponse, cchResponse, lpszText2);
        delete[] lpszText2;
    }
	
}


Privacy Statement. Copyright 2000-2008 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, and Windows 95/98/NT4.