Example #1
0
 def run(self):
     try:
         self.data = urllib.urlencode(self.data)
         r = urllib2.urlopen(self.url, self.data)
         r.read()
     except Exception as e:
         LOGGER.error(e)
         LOGGER.exception(e)
Example #2
0
 def run(self):
     orignal_timeout = socket.getdefaulttimeout()
     try:
         self.data = urllib.urlencode(self.data)
         socket.setdefaulttimeout(WEBHOOK_HTTP_TIMEOUT)
         r = urllib2.urlopen(self.url, self.data)
         r.read()
     except Exception as e:
         logger.error(e)
         logger.exception(e)
     finally:
         socket.setdefaulttimeout(orignal_timeout)