curlify
curlify copied to clipboard
feat: support custom http scheme
If you use a custom http scheme (like http-custom://aaa.bbb.ccc/path) and use your custom HTTPConnectionPool to parse it to generate a http connection, to_curl will give you inappropriate result:
resp = requests.get("http-custom://microservice.address/api/path")
curlify.to_curl(resp.request) # curl -X GET http-custom://microservice.address/api/path
I created to_raw_http_curl to solve this kind of problem:
resp = requests.get("http-custom://microservice.address/api/path")
curlify.to_raw_http_curl(resp) # curl -X GET http://11.22.33.44:80/api/path