Thanks. A bit of a background I should have posted: I want to avoid using HTTPoison / hackney and use either mint directly or with a wrapper called mojito. Unfortunately these don’t have part that assembles “multipart/form-data” requests, so I either have to find one from some other library, or write one myself.
Ah, I see. Yeah, since they’re pretty new and Mint itself is not necessarily designed for “regular” use cases (although mojito is), you’re likely to have to write something yourself if mojito doesn’t support it.
Hackney has got issues that I stumbled upon recently (among others before), but I don’t think I like how it depends on application configuration either, things get quite difficult once you have to deal with SSL / self-signed certificates or client SSL authentication. And I had fair amount of issues on production with using it too, although not recent. There’s a thread on this forum from 2017 where I argued we need a better built-in HTTP client library in Elixir itself.
Mint comes as close as it gets to what I wanted the standard HTTP client to be, it’s idiomatic Elixir, it’s low level enough that you can build idiomatic clients on top of it (like mojito) and from what I saw really like it’s design. It’s a good reading if one wants to learn how to deal with TCP/SSL connections in Elixir too. Very educational
I think I prefer to put in some effort working on getting it up to desired shape myself rather than plan for another battle agains HTTPoison/hackney.
I think they will but need some minor tweaks in terms of naming things I thunk. I will try to do it tonight and let you know. Nothing from API should change so I guess you can try from my branch/pr, in fact, another pair of eyes testing this would be very much welcome.
niedz., 13 gru 2020, 14:01 użytkownik Ijunaidfarooq via Elixir Programming Language Forum <noreply@elixirforum.com> napisał:
I could use hackney directly, yes, and I have been doing it but it’s a low level API. As far as I know, and I inspected HTTPoison code pretty intensely to find a way to do it, it can’t stream request body. It can stream the response from the server, but it doesn’t allow me to stream request. I think hackney or ibrowse (or a Tesla wrapper for either) used directly could do it, however.
And I think you may have asked here about documentation and you are right, once my PR is merged I will work on some documentation to how to use it. I suppose you figured out the way to use http basic auth but otherwise hit me up, I am doing the same.