Equivalent HTML Form and Chilkat HTTP POST

Any HTML form POST can be duplicated programmatically with the Chilkat HTTP component.

As an example, consider this HTML:

<html>
<body>
<form name="input" action="http://www.chilkatsoft.com/testPostHandler.asp"
method="post">
Arg1: 
<input type="text" name="arg1">
<br>(Arg2 is a hidden input)<br>
<input type="hidden" name="arg2" value="abc123">
Arg3 
<input type="text" name="arg3">
<input type="submit" value="Submit">
</form>
</body>
</html>

It submits a POST to http://www.chilkatsoft.com/testPostHandler.asp. The ASP that receives the post is as follows:

<html>
<head>
<title>Chilkat Test HTTP POST Handler</title>
</head>
<body>
<h1>Test HTTP POST Handler</h1>
<p><b>arg1:</b></p>
<pre>
<%
	Response.Write(Request.form("arg1"))
%>
</pre>
<p><b>arg2:</b></p>
<pre>
<%
	Response.Write(Request.form("arg2"))
%>
</pre>
<p><b>arg3:</b></p>
<pre>
<%
	Response.Write(Request.form("arg3"))
%>
</pre>
</body>
</html>

This may be tested online by going to http://www.chilkatsoft.com/testPost.asp

To duplicate using Chilkat HTTP, set the request object’s Path property equal to the form action, and call AddParam for each Form input. Examples in various programming languages may be found at the links below:

ASP: HTTP POST
SQL Server: HTTP POST
C#: HTTP POST
C++: HTTP POST
C: HTTP POST
Delphi: HTTP POST
Visual FoxPro: HTTP POST
Java: HTTP POST
Perl: HTTP POST
PHP: HTTP POST
Python: HTTP POST
Ruby: HTTP POST
VB.NET: HTTP POST
Visual Basic: HTTP POST
VBScript: HTTP POST

Tags :