我试图建立一个HTTP连接,但得到错误:
“http.client.InvalidURL:数字端口:'80 / test / path'
代码:
Import http.client
self.conn = http.client.HTTPConnection("192.168.1.1:80/test/path") #"[ip]/[path],[port] does'nt work either
# some post and put requests
工作代码:
Import requests
requests.post('192.168.1.1:80/test/path',data='testdata')
如何使用ip,port和path建立HTTP连接?