lyd2004888 发表于 2017-4-26 09:52:11

python httplib.HTTPSConnection

notifyHost = ""
notifyPort =
conn = httplib.HTTPSConnection(notifyHost, notifyPort, timeout=50)
requestUrl = "/openapi?list=" + urllib.quote(content)
print requestUrl

try:
    conn.request("GET", requestUrl)
    resp = conn.getresponse()
    pic_data = resp.read()

    if resp.status != 200:
      print "/camfs/download HTTP " + str(resp.status)
      print resp.getheaders()
    else:
      print "success"
      print pic_data

except:
    print "except"
页: [1]
查看完整版本: python httplib.HTTPSConnection