2

The situation

I'm trying to connect to a server on https protocol with python script. Could someone give me the working example that sends a GET request to https server, or web resource to how to create https connection with python?

An attempt so far

I have learned that the module httplib on python supports creation of http connection, but not https connection?

import httplib

conn = httplib.HTTPConnection('https://adsche.skplanet.com/api/startNewTurn')
header = {"Content-type" : "application/json"}
conn.request('GET', '/announce?info_hash=%da', '', header)
r1 = conn.getresponse()
print r1.status, r1.reason
data1 = r1.read()
print data1
inherithandle
  • 2,614
  • 4
  • 31
  • 53

0 Answers0