labpack/email/mandrill.py
def _post_request(self, url, json):

        ''' a helper method for handling post requests '''

        import requests

    # construct request kwargs
        request_kwargs = {
            'url': url,
            'json': { 'key': self.api_key }
        }
        request_kwargs['json'].update(**json)

    # send request
        try:
            response = requests.post(**request_kwargs)
        except Exception:
            if self.requests_handler:
                request_kwargs['method'] = 'POST'
                request_object = requests.Request(**request_kwargs)
                return self.requests_handler(request_object)
            else:
                raise

    # handle response
        response_details = self.service_handler.handle(response)

        return response_details
 a helper method for handling post requests 
a helper method for handling post requests
a helper method for handling post requests
def _post_request(self, url, json):
        import requests
        request_kwargs = {
            'url': url,
            'json': { 'key': self.api_key }
        }
        request_kwargs['json'].update(**json)
        try:
            response = requests.post(**request_kwargs)
        except Exception:
            if self.requests_handler:
                request_kwargs['method'] = 'POST'
                request_object = requests.Request(**request_kwargs)
                return self.requests_handler(request_object)
            else:
                raise
        response_details = self.service_handler.handle(response)
        return response_details
def _post_request ( self , url , json ) : import requests request_kwargs = { 'url' : url , 'json' : { 'key' : self . api_key } } request_kwargs [ 'json' ] . update ( ** json ) try : response = requests . post ( ** request_kwargs ) except Exception : if self . requests_handler : request_kwargs [ 'method' ] = 'POST' request_object = requests . Request ( ** request_kwargs ) return self . requests_handler ( request_object ) else : raise response_details = self . service_handler . handle ( response ) return response_details
a helper method for handling post requests
a helper method for handling post requests
''' a helper method for handling post requests ''' # construct request kwargs
 # send request
 # handle response

self
url
json