added quiet access to successful calls for http
@@ -212,12 +212,13 @@ class Response(object):
class HttpTransport(Invoker):
- async def request_handler(cls: Any, obj: Any, context: Dict, func: Any, method: str, url: str) -> Any:
+ async def request_handler(cls: Any, obj: Any, context: Dict, func: Any, method: str, url: str, quiet_access: bool = False) -> Any:
pattern = r'^{}$'.format(re.sub(r'\$$', '', re.sub(r'^\^?(.*)$', r'\1', url)))
compiled_pattern = re.compile(pattern)
default_content_type = context.get('options', {}).get('http', {}).get('content_type', 'text/plain')
default_charset = context.get('options', {}).get('http', {}).get('charset', 'utf-8')
+ context['quiet_access'] = quiet_access
if default_content_type is not None and ";" in default_content_type:
# for backwards compability
@@ -589,6 +590,9 @@ class HttpTransport(Invoker):
if not request._cache.get('is_websocket'):
status_code = response.status if response is not None else 500
+ if status_code >= 200 and status_code <= 299 and context.get('quiet_access', False):
+ pass
+ else:
logging.getLogger('transport.http').info('[{}] [{}] {} {} "{} {}{}{}" {} {} "{}" {}'.format(
RequestHandler.colorize_status('http', status_code),
RequestHandler.colorize_status(status_code),
