kitir/kits/restful_api.py
def _log_response_full(cls, response, response_file_path):
        """log the full response side of a transaction"""
        assert isinstance(response, requests.Response)
        _ignore_fields = ['history', 'links', 'raw', 'reason', 'next', 'connection', 'request', 'text']
        data = {
            'ok': response.ok,
            'url': response.url,
            'headers': dict(response.headers),
            'elapsed': str(response.elapsed),
            'status_code': response.status_code,
            'content': cls._get_content_from_response(response, prefer_json=True),
            'encoding': response.encoding,
            'apparent_encoding': response.apparent_encoding,
            'is_redirect': response.is_redirect,
            'is_permanent_redirect': response.is_permanent_redirect,
            '__meta__': 'Response object: content is json if possible. Excluding fields: {}'.format(_ignore_fields)
        }
        utils.write_json(response_file_path, data, json_kwargs={'indent': 4, 'sort_keys': True})
log the full response side of a transaction
log the full response side of a transaction
log the full response side of a transaction
def _log_response_full(cls, response, response_file_path):
        assert isinstance(response, requests.Response)
        _ignore_fields = ['history', 'links', 'raw', 'reason', 'next', 'connection', 'request', 'text']
        data = {
            'ok': response.ok,
            'url': response.url,
            'headers': dict(response.headers),
            'elapsed': str(response.elapsed),
            'status_code': response.status_code,
            'content': cls._get_content_from_response(response, prefer_json=True),
            'encoding': response.encoding,
            'apparent_encoding': response.apparent_encoding,
            'is_redirect': response.is_redirect,
            'is_permanent_redirect': response.is_permanent_redirect,
            '__meta__': 'Response object: content is json if possible. Excluding fields: {}'.format(_ignore_fields)
        }
        utils.write_json(response_file_path, data, json_kwargs={'indent': 4, 'sort_keys': True})
def _log_response_full ( cls , response , response_file_path ) : assert isinstance ( response , requests . Response ) _ignore_fields = [ 'history' , 'links' , 'raw' , 'reason' , 'next' , 'connection' , 'request' , 'text' ] data = { 'ok' : response . ok , 'url' : response . url , 'headers' : dict ( response . headers ) , 'elapsed' : str ( response . elapsed ) , 'status_code' : response . status_code , 'content' : cls . _get_content_from_response ( response , prefer_json = True ) , 'encoding' : response . encoding , 'apparent_encoding' : response . apparent_encoding , 'is_redirect' : response . is_redirect , 'is_permanent_redirect' : response . is_permanent_redirect , '__meta__' : 'Response object: content is json if possible. Excluding fields: {}' . format ( _ignore_fields ) } utils . write_json ( response_file_path , data , json_kwargs = { 'indent' : 4 , 'sort_keys' : True } )
log the full response side of a transaction
log the full response side of a transaction
"""log the full response side of a transaction"""
cls
response
response_file_path