w3Sockets Examples

Examples

HTTP post

 

This is a small sample on how to make postings to webpages. It'll help you to get started. (Kudos to David Cragg for helping us making this sample better)

   httpPost.asp

<%@ LANGUAGE="JavaScript" %> <%

socket = Server.CreateObject( "Socket.TCP" );

postData = "action=test&id=2000"
socket.SendLine "POST /testPost.asp HTTP/1.0"
socket.SendLine "Server: www.myserver.com"
socket.SendLine "Content-Length: " & len( postData )
Socket.SendLine "Content-Type: application/x-www-form-urlencoded"
socket.SendLine ""
socket.SendLine postData %>

<body>
<html>
There you go!
</body>
</html>