curlify icon indicating copy to clipboard operation
curlify copied to clipboard

feat: support custom http scheme

Open ritajie opened this issue 4 years ago • 0 comments

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

ritajie avatar Sep 30 '21 09:09 ritajie