Proxies¶
The ThreatConnect TcEx App Framework provides the proxies
property to automatically create a dictionary with the properly formatted proxy settings used by the Python Requests module.
Note
When using the tcex_resources()
module or session
property, the proxies are automatically configured.
Hint
The proxies
property can be helpful when using the TcExRequest
module.
Example Request using Proxy¶
1 2 3 4 5 6 | r = tcex.request
if args.tc_proxy_external:
r.proxies = tcex.proxies
r.url = 'https://remote_api.example'
r.add_payload('api_key', 'abc123')
response = r.send()
|