Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

C# Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GMail REST API
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Sheets
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)

Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
Upload
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(C#) Send XMLHttpRequest and Get Response

Demonstrates how to send an HTTP XML request and retrieve the response.

Chilkat .NET Downloads

Chilkat .NET Assemblies

Chilkat for .NET Core

Chilkat for Mono

Chilkat.Http http = new Chilkat.Http();

bool success;

//  Any string unlocks the component for the 1st 30-days.
success = http.UnlockComponent("Anything for 30-day trial");
if (success != true) {
    Console.WriteLine(http.LastErrorText);
    return;
}

//  The XML sent in the body of the request is application
//  specified -- it should contain whatever the server-side
//  application is expecting..
string xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><appXml><something>123</something></appXml>";

//  The PostXml method may be called to send the XMLHttpRequest
//  using the "POST" HTTP method (also known as "verb").
string urlEndpoint = "http://www.chilkatsoft.com/xmlEcho.asp";
string xmlCharset = "utf-8";

Chilkat.HttpResponse response = null;
response = http.PostXml(urlEndpoint,xmlStr,xmlCharset);
if (response == null ) {
    Console.WriteLine(http.LastErrorText);
    return;
}

//  The raw HTTP request sent by the above call is:

/*
POST /xmlEcho.asp HTTP/1.1
Content-Type: text/xml
User-Agent: Chilkat/1.0.0 (+http://www.chilkatsoft.com/ChilkatHttpUA.asp)
Host: www.chilkatsoft.com
Accept: */*
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*; q=0.7
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip
Content-Length: 81

<?xml version="1.0" encoding="UTF-8"?><appXml><something>123</something></appXml>
*/ // Examine the Body of the HTTP response // This would be the XML response sent by the server. Console.WriteLine(response.BodyStr);
 

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