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"
Printable View
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"
What are you actually trying to post?Quote:
MDIForm1.winOut.SendData "POST /p2p/list.php HTTP/1.0"
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"
Yep, thanks, i noticed that shortly after posting, but it doesn't seem to of had any effect :(
Thanks anyway
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'
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.
Check out http://www.winsockvb.com for more on Winsock and HTTP.Code:MDIForm1.winOut.SendData "GET /p2p/list.php HTTP/1.0" & vbCrLf & vbCrLf