defaultHost = None
class GatewayRequest:
+
+ ''' package-wide default protocol '''
+ default_protocol = 'https'
+
def __init__(self, service, method, params=[]):
self.service = service
self.method = method
self.params = params
self.path = 'gateway'
self.bytes_read = 0 # for now this, this is really characters read
+ # request-specific protocol
+ self.proto = GatewayRequest.default_protocol
def setPath(self, path):
self.path = path
setDefaultHost = staticmethod(setDefaultHost)
def buildURL(self):
- return 'http://%s/%s' % (defaultHost, self.path)
+ return '%s://%s/%s' % (self.proto, defaultHost, self.path)
class JSONGatewayRequest(GatewayRequest):
def __init__(self, service, method, *params):