Exemple #1
0
 def _urlcall(self, url, params, data, urltype):
     loglines = []
     urldata = ''
     try:
         if urltype == "get":
             urldata = _requests.get(url,
                                     params=params,
                                     timeout=self.timeout)
         elif urltype == "post":
             urldata = _requests.post(url,
                                      params=params,
                                      data=data,
                                      headers=self.headers,
                                      timeout=self.timeout)
         elif urltype == "delete":
             urldata = _requests.delete(url,
                                        params=params,
                                        data=data,
                                        headers=self.headers,
                                        timeout=self.timeout)
         loglines.append("the url is: " + urldata.url)
         loglines.append('the params are: ')
         loglines.append(params)
         loglines.append('the data are: ')
         loglines.append(data)
     except _requests.exceptions.ConnectionError, e:
         loglines.append('site unreachable at ' + url)
         loglines.append(e)
Exemple #2
0
 def _urlcall( self, url, params, data, urltype ):
     loglines = []        
     urldata = ''
     try:
         if urltype == "get":
             urldata = _requests.get( url, params=params, timeout=self.timeout )
         elif urltype == "post":
             urldata = _requests.post( url, params=params, data=data, headers=self.headers, timeout=self.timeout )
         elif urltype == "delete":
             urldata = _requests.delete( url, params=params, data=data, headers=self.headers, timeout=self.timeout )
         loglines.append( "the url is: " + urldata.url )
         loglines.append( 'the params are: ')
         loglines.append( params )
         loglines.append( 'the data are: ')
         loglines.append( data )
     except _requests.exceptions.ConnectionError, e:
         loglines.append( 'site unreachable at ' + url )
         loglines.append( e )
Exemple #3
0
	def deletePush(self,ID):
		if isinstance(ID,dict): ID = ID.get('iden')
		requests.delete(self.baseURL.format('pushes/{0}'.format(ID)),auth=(self.token,''))
Exemple #4
0
 def deletePush(self, ID):
     if isinstance(ID, dict): ID = ID.get('iden')
     requests.delete(self.baseURL.format('pushes/{0}'.format(ID)),
                     auth=(self.token, ''))