We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Last week I was debugging an integration I had built with a 3rd party API. Nothing was going right, and to make matters worse, the error code I was getting back ("611 system error") wasn't helpful in the least. I needed to open a support ticket to proceed.
I use Req to make HTTP requests, but I can't just paste my
%Req.Request{}
struct into an email and expect the person on the other side (who has no knowledge of Elixir) to understand what is going on. So there I was, converting my request struct into an equivalent curl command when I thought "surely someone has built this as a library already!". Unfortunately this turned out not to be the case, so the obvious follow-up thought popped into my head, "gap in the market!" and I set out to build my own.request |> CurlReq.inspect(label: "MY_REQUEST") |> Req.request!()
Getting a working
to_curl/1
function was not really that hard. Addinginspect/2
makes it a lot more ergonomic, since now you can just toss in a line right before you make your request. This is quite useful and I expect it will make some people happy.Now my itch has been scratched, and I invite whoever is reading this announcement to use this library if you find it useful, and if you find it lacking, or discover your own itches to scratch, to improve it with a PR! You can find the package here: GitHub, hex.pm, and hexdocs.
continue reading on codecodeship.com
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.