Results 1 to 4 of 4

Thread: POST and GET methods with vb6

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    9

    POST and GET methods with vb6

    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.

  2. #2
    Lively Member
    Join Date
    May 2005
    Posts
    90

    Re: POST and GET methods with vb6

    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!
    ^_^

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: POST and GET methods with vb6

    Have a look at the links in my signature
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    9

    Re: POST and GET methods with vb6

    Thanks all. I downloaded your Winsock-based application and code, and it's exactly what I needed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width