PDA

Click to See Complete Forum and Search --> : POST and GET methods with vb6


slawek
Dec 1st, 2005, 07:40 PM
I'm starting on a custom code to control a networked device. The device has it's own web server that can be accessed through IE or with a special application. The communication is achieved with a series of calls using either POST or GET methods. How do I go about programming them into vb6? For example, in order to set the language of the device, the following sequence is required:

POST/main.cgi HTTP/1.1
Authorization: Basic xxxx
Cookie: DSRSESS=xxxxxxxxxxxxxxx
lang=xxx&gmt=xxxx&gmt1y=xxxxx

To which the unit should respond:

HTTP/1.0 200 OK

How do I send this POST message and how do I listen to the unit response? I appreciate any help.

MalcolmCarmen
Dec 2nd, 2005, 02:04 PM
What you'll want to do it look into using VB6's Winsock OCX, or take the time to search google for a better solution known as "CSocket." Either way, both are implementations of the underlying Windows API for TCP sockets.

Sockets on a basic level simply manage sending and receiving network data over either TCP (used by HTTP, FTP, SMTP, etc) and UDP (games, some DNS schemes).

Search on google or planetsourcecode.com for "socket VB6 get http", you should find a ton of examples showing a page being retrieved in such a manner as you've described.

Good luck!

visualAd
Dec 4th, 2005, 07:13 AM
Have a look at the links in my signature ;)

slawek
Dec 4th, 2005, 11:49 AM
Thanks all. I downloaded your Winsock-based application and code, and it's exactly what I needed.