You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Sources/pyOpenRPA/Utils/Network.py

17 lines
584 B

import requests
def RequestPrettyPrint(inRequest):
"""
At this point it is completely built and ready
to be fired; it is "prepared".
However pay attention at the formatting used in
this function because it is programmed to be pretty
printed and may differ from the actual request.
"""
prepared = inRequest.prepare()
print('{}\n{}\r\n{}\r\n\r\n{}'.format(
'-----------START-----------',
prepared.method + ' ' + prepared.url,
'\r\n'.join('{}: {}'.format(k, v) for k, v in prepared.headers.items()),
prepared.body,
))