smsprovider.HttpSMSProvider module

This is the SMSClass to send SMS via HTTP Gateways

class smsprovider.HttpSMSProvider.HttpSMSProvider[source]

Bases: smsprovider.SMSProvider.ISMSProvider

getParameters(message, phone)[source]
get_proxy_info(proxy)[source]

helper to parse the proxyurl and to create the proxy_info object

Parameters:proxy – proxy url string
Returns:ProxyInfo object
httplib_request(url, parameter, username=None, password=None, method='GET')[source]

build the urllib request and check the response for success or fail

Parameters:
  • url – target url
  • parameter – additonal parameter to append to the url request
  • username – basic authentication with username (optional)
  • password – basic authentication with password (optional)
  • method – run an GET or POST request
Returns:

False or True

loadConfig(configDict)[source]
requests_request(url, parameter, username=None, password=None, method='GET')[source]
static urlencode(parameter)[source]
helper method:
urllib.urlencode does by default url_quote, which converts ‘ ‘ spaces into ‘+’ symbol, which is not understood by all HTTPSMSProviders This helper uses urllibquote to build the encoded parameter string
Parameters:parameter – dictionary
Returns:urlencoded string of type str() as unicode is not supported
urllib_request(url, parameter, username=None, password=None, method='GET')[source]

build the urllib request and check the response for success or fail

Parameters:
  • url – target url
  • parameter – additonal parameter to append to the url request
  • username – basic authentication with username (optional)
  • password – basic authentication with password (optional)
  • method – run an GET or POST request
Returns:

False or True