Results 1 to 7 of 7

Thread: How to send POST data with Winsock in VB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Posts
    24

    How to send POST data with Winsock in VB

    I am trying to send POST data with Microsoft Winsock control but keep on receiving garbage from the webserver. Can anyone tell me the reason please?

    What I send:

    POST /search HTTP/1.1
    Host: www.google.com
    Content-Length: 30
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Media Center PC 3.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
    Content-Type: application/x-www-form-urlencoded
    Accept-Encoding: gzip, deflate
    Connection: close

    hl=en&q=sql+tutorial&btnG=Google+Search

    What I get:

    HTTP/1.1 501 Not Implemented
    Connection: close
    Content-Type: text/html
    Server: GWS/2.1
    Transfer-Encoding: chunked
    Content-Encoding: gzip
    Date: Mon, 23 Oct 2006 17:08:55 GMT
    Cache-Control: private, x-gzip-ok=""

  2. #2

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Posts
    24

    Re: How to send POST data with Winsock in VB

    Anyone please?

  3. #3
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: How to send POST data with Winsock in VB

    POst the code in its entirety that is how you built up the code and what method you used to send it via winsock??
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

  4. #4

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Posts
    24

    Re: How to send POST data with Winsock in VB

    Quote Originally Posted by litlewiki
    POst the code in its entirety that is how you built up the code and what method you used to send it via winsock??
    I used the same code as http://www.vbip.com/winsock/winsock_http_03_01.asp and tweaked it like the author said in http://www.vbip.com/forum/topic.asp?id=4

    But it is not working as said.

  5. #5
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: How to send POST data with Winsock in VB

    I think a simple get request should work just follow the get example mentioned there.

    Also take a look at the winsock sample by visualad in the codebank section

    Code:
    http://www.google.com/search?hl=en&q=sql**tutorial&btnG=Google+Search&meta=
    is a sample get request btw
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

  6. #6

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Posts
    24

    Re: How to send POST data with Winsock in VB

    Quote Originally Posted by litlewiki
    I think a simple get request should work just follow the get example mentioned there.

    Also take a look at the winsock sample by visualad in the codebank section

    Code:
    http://www.google.com/search?hl=en&q=sql**tutorial&btnG=Google+Search&meta=
    is a sample get request btw
    Is there a sample code available anywhere which shows how to use Winsock to send POST data?

  7. #7
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: How to send POST data with Winsock in VB

    http://www.vbforums.com/showthread.p...hlight=winsock

    dload the example ,build up your get data and see for yourself
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

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