- Код: Выделить всё
Private Sub cmdSend_Click()
wskHttp.Protocol = sckTCPProtocol
wskHttp.Connect "130.193.66.233", 80
While Not wskHttp.State = 7
DoEvents
Wend
Parametrs = "city=5192&lang=ru"
wskHttp.SendData "GET /inform-service/0f14315098daad405ded9270d1500bcb/forecast/?" & Parametrs & " HTTP/1.0" & vbCrLf & vbCrLf
wskHttp.SendData "Host: d6a5c954.services.Gismeteo.ru " & vbCrLf
wskHttp.SendData "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:46.0) Gecko/20100101 Firefox/46.0" & vbCrLf
wskHttp.SendData "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" & vbCrLf
wskHttp.SendData "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3" & vbCrLf
wskHttp.SendData "Accept-Encoding: gzip, deflate" & vbCrLf
wskHttp.SendData "Connection: keep-alive" & vbCrLf
End Sub
Private Sub wskHttp_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
wskHttp.GetData Data
rtbData.Text = Data
End Sub
Вот какой приходит ответ от сервера:
HTTP/1.1 500 Internal Server Error
Server: openresty/1.9.3.1
Date: Sun, 05 Jun 2016 09:25:38 GMT
Content-Type: text/xml; charset=utf-8
Connection: close
X-Gismeteo-Timestamp: 1465118738
X-Gismeteo-TimestampStr: 2016/06/05 09:25:38
Access-Control-Expose-Headers: X-Gismeteo-TimestampStr, X-Gismeteo-Timestamp
<html>
<head><title>500 Internal Server Error</title></head>
<body bgcolor="white">
<center><h1>500 Internal Server Error</h1></center>
<hr><center>openresty/1.9.3.1</center>
</body>
</html>