I decided to tackle this myself and its not receiving any image. I'm getting a bad request response:-
This is my test code:-Code:HTTP/1.1 400 Bad Request Server: nginx Date: Tue, 29 Jul 2014 01:40:30 GMT Content-Type: text/html Content-Length: 166 Connection: close <html> <head><title>400 Bad Request</title></head> <body bgcolor="white"> <center><h1>400 Bad Request</h1></center> <hr><center>nginx</center> </body> </html>
vb Code:
Private strReceivedData As String Private Sub Form_Load() Winsock1.Connect "www.games5.sepanta.com", 80 End Sub Private Sub Winsock1_Close() Debug.Print strReceivedData End Sub Private Sub Winsock1_Connect() Dim strHeader As String strHeader = "GET /forum/uploads/profile/photo-thumb-2.jpg HTTP/1.1" & vbCrLf & vbCrLf Winsock1.SendData strHeader End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Dim strn As String Winsock1.GetData strn, vbString, bytesTotal strReceivedData = strReceivedData + strn 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) MsgBox "Winsock error:" + Description End Sub




Reply With Quote