Why am I getting this error in python ? (httplib)

后端 未结 10 1705
情话喂你
情话喂你 2020-11-27 20:11
if theurl.startswith(\"http://\"): theurl = theurl[7:]
    head = theurl[:theurl.find(\'/\')]
    tail = theurl[theurl.find(\'/\'):]
response_code = 0
import httplib         


        
10条回答
  •  盖世英雄少女心
    2020-11-27 20:55

    I just found when we get exception httplib.BadStatusLine , is when server goes down and doesn't send any response, so it means web server doesn't even send the http code [1]

    [1] http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

提交回复
热议问题