Skip to content

Commit

Permalink
Merge pull request iyzico#25 from murat-saglam/develop
Browse files Browse the repository at this point in the history
Python 2.6 support for HTTPS connection library
  • Loading branch information
yyenigun authored Aug 15, 2016
2 parents 4d467e1 + ece90c4 commit 77101e3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iyzipay/iyzipay_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import string
import base64
import hashlib
import http.client
import json
import sys
import iyzipay
Expand All @@ -15,7 +14,12 @@ def __init__(self):
RANDOM_STRING_SIZE = 8

def connect(self, method, url, options, request=None, pki=None):
connection = http.client.HTTPSConnection(options['base_url'])
if (2,6) <= sys.version_info < (3,0):
import httplib
connection = httplib.HTTPSConnection(options['base_url'])
else:
import http.client
connection = http.client.HTTPSConnection(options['base_url'])
request_json = json.dumps(request)
connection.request(method, url, request_json, self.get_http_header(options, pki))
return connection.getresponse()
Expand Down

0 comments on commit 77101e3

Please sign in to comment.