Results 1 to 2 of 2

Thread: RESOLVED HTTP/Winsock Help

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    1

    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.

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: HTTP/Winsock Help

    You need to append 2 new lines at the end of the HTTP header.

    vbCrLf & vbCrLf

    Some other things:

    1. What is being received in the DataArrival event?
    2. Might not be enough info in the HTTP header
    3. 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
  •  



Click Here to Expand Forum to Full Width