in src/mapillary/models/client.py [0:0]
def _pprint_request(prepped_req):
"""
Format::
Method endpoint: HTTP/version
Host: host
Header_key: Header_value
Body
:param prepped_req: The prepped request object
Reference::
1. 'https://github.com/michaeldbianchi/Python-API-Client-Boilerplate/blob/fd1c82be9e98e'
'24730c4631ffc30068272386669/exampleClient.py#L202'
"""
method = prepped_req.method
url = prepped_req.url
headers = "\n".join(f"{k}: {v}" for k, v in prepped_req.headers.items())
# Print body if present or empty string if not
body = prepped_req.body or ""
logger.info(f"Requesting {method} to {url}")
logger.debug(
"{}\n{} {} HTTP/1.1\n{}\n\n{}".format(
"-----------REQUEST-----------", method, url, headers, body
)
)