|
-
Jan 26th, 2007, 05:29 PM
#1
Thread Starter
New Member
RESOLVED HTTP/Winsock Help
Bah, I just needed to take the conversion out!
RESOLVED!
Hey guys, I'm trying to send a HTTP request in Visual Basic 6 through Winsock. However, the request doesn't seem to be going through correctly, and the page that the request is being sent to is not running.
Here's the code:
Code:
Private Sub Form_Load()
Call Winsock1.Connect
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call Winsock1.Close
End Sub
Private Sub Winsock1_Connect()
Dim message As String
message = "GET /winsock.php HTTP/1.1" & vbCrLf & "Host: thedragoongame.com"
message = StrConv(message, vbFromUnicode)
Winsock1.SendData (message)
End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Call MsgBox(Description)
End Sub
Winsock is connecting successfully to the server. But my HTTP GET request isn't going through at all it seems. Any help would be greatly appreciated, thanks guys.
Last edited by bforbes; Jan 26th, 2007 at 06:32 PM.
-
Jan 26th, 2007, 06:31 PM
#2
Re: HTTP/Winsock Help
You need to append 2 new lines at the end of the HTTP header.
vbCrLf & vbCrLf
Some other things:
- What is being received in the DataArrival event?
- Might not be enough info in the HTTP header
- Why are you using StrConv()?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|