def _prepare_request_message(request): return { 'url': to_unicode(request.url), 'method': to_unicode(request.method), 'headers': dict_to_unicode(request.headers), 'cookies': dict_to_unicode(request.cookies), 'meta': dict_to_unicode(request.meta) }
def _prepare_response_message(response, send_body): return { 'url': to_unicode(response.url), 'status_code': response.status_code, 'meta': dict_to_unicode(response.meta), 'body': to_unicode(b64encode(response.body)) if send_body else None }
def _prepare_response_message(response, send_body): return {'url': to_unicode(response.url), 'status_code': response.status_code, 'meta': dict_to_unicode(response.meta), 'body': to_unicode(b64encode(response.body)) if send_body else None}
def _prepare_request_message(request): return {'url': to_unicode(request.url), 'method': to_unicode(request.method), 'headers': dict_to_unicode(request.headers), 'cookies': dict_to_unicode(request.cookies), 'meta': dict_to_unicode(request.meta)}