VB Code:
Private Sub Form_Load()
With Winsock1
.Close
.LocalPort = 0
.Connect "www.myurl.com", 80
End With
End Sub
Private Sub Winsock1_Connect()
Dim strData As String
strData = "GET / HTTP/1.1" & vbCrLf
strData = strData & "Host: www.myurl.com" & vbCrLf
strData = strData & "Connection: close" & vbCrLf
strData = strData & "Accept: */*" & vbCrLf
strData = strData & vbCrLf
Winsock1.SendData strData
Debug.Print strData
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim strHeader As String
Winsock1.GetData strData
strHeader = Left$(strData, InStr(1, strData, vbCrLf & vbCrLf) - 1)
strData = Mid(strData, InStr(1, strData, vbCrLf & vbCrLf) + 4)
Debug.Print Trim$(strData)
End Sub