當我的燒瓶應用程序啓動時,它說如何發送HTTP請求到服務器瓶中
Running on http://0.0.0.0:80/
如何發送HTTP請求到該服務器?
我試圖
telnet 0.0.0.0 80
但它說:
Trying 0.0.0.0...
telnet: connect to address 0.0.0.0: Invalid argument
我使用的請求模塊:
r = requests.get('http://0.0.0.0:80')
它說了同樣的結果
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 288, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 383, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 206, in send
raise ConnectionError(sockerr)
requests.exceptions.ConnectionError: [Errno 22] Invalid argument
的netstat的輸出如下:
# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:domain 0.0.0.0:* LISTEN
tcp6 0 0 [::]:domain [::]:* LISTEN
udp 0 0 0.0.0.0:domain 0.0.0.0:*
udp 0 0 0.0.0.0:bootps 0.0.0.0:*
udp6 0 0 [::]:domain [::]:*
您是否嘗試過提出這樣的請求?r = requests.get('http://0.0.0.0')'? –
@BubbleHacker:試過。相同的結果 –
您是否嘗試過從網絡瀏覽器進行訪問?也許問題出在服務器端。 –