[erlang-questions] HTTP client for OAuth
Thu Feb 25 04:49:23 CET 2016
On 02/24/2016 07:49 AM, Garrett Smith wrote:
> I'm interfacing with various OAuth providers within an Erlang
> application and I need a simple HTTP client. I've poked around the
> ecosystem and have learned that HTTP clients are the new MySQL clients
> in terms of which-one-to-freakin-use.
When I was writing a client for a proprietary backend that used HTTP and
required its own authentication, I decided to split things up a bit: I
created an HTTP client wrapper that accomplished 3 things:
- acted as a wrapper over a number of actual HTTP clients via a behavior
(initially supporting gun and httpc, was planning to add hackney later)
- exposed a behavior for authentication
- exposed a behavior for application specific functionality/requests
You can see the sample implementation.
My intent was to create an HTTP client application where you would only
need to plug in your custom application functions and authentication. I
haven't updated it in a while, so I wouldn't be surprised if it's broken
against current gun.
 https://github.com/unix1/httpclient (I know, very poorly named)
More information about the erlang-questions