Results 1 to 6 of 6

Thread: Winsock and webserver

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Scotland, UK
    Posts
    321

    Winsock and webserver

    Hi, I have connected a web server, and am trying to retrieve a page using winsock. However the server doesn't appear to send anything back.

    Am I sending the correct thing?

    Code:
    MDIForm1.winOut.SendData "POST /p2p/list.php HTTP/1.0"

  2. #2
    Member
    Join Date
    May 2002
    Location
    Manchester, UK
    Posts
    54

    Re: Winsock and webserver

    MDIForm1.winOut.SendData "POST /p2p/list.php HTTP/1.0"
    What are you actually trying to post?

  3. #3
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    If you want to RETRIEVE a file, you have to use GET, not POST.
    Code:
    MDIForm1.winOut.SendData "GET /p2p/list.php HTTP/1.0"
    <removed by admin>

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Scotland, UK
    Posts
    321
    Yep, thanks, i noticed that shortly after posting, but it doesn't seem to of had any effect

    Thanks anyway

  5. #5
    Member
    Join Date
    May 2002
    Location
    Manchester, UK
    Posts
    54
    After sending the file request, you need to post a couple of headers about your web browser. I'm not sure what they are, though. Search the internet for 'Http headers'

  6. #6
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    uk
    Posts
    327
    You don't need to submit the headers, but you do need to make sure you place two carriage return characters after your request. This lets the webserver know that its reached the end of the request and that it should send back the data.
    Code:
    MDIForm1.winOut.SendData "GET /p2p/list.php HTTP/1.0"  & vbCrLf & vbCrLf
    Check out http://www.winsockvb.com for more on Winsock and HTTP.

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