# Standard HTTP Client behaviour - feature request

**URL:** <https://forum.elixirforum.com/t/standard-http-client-behaviour-feature-request/46857>\
**Category:** Discussions\
**Tags:** api, http\_client\
**Created:** [March 28, 2022, 10:09am UTC](https://forum.elixirforum.com/t/standard-http-client-behaviour-feature-request/46857 "2022-03-28T10:09:53Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![wojtekmach](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wojtekmach/32/999_2.png) [@wojtekmach](https://forum.elixirforum.com/u/wojtekmach)\
**Post date:** [May 23, 2022, 11:28am UTC](https://forum.elixirforum.com/t/standard-http-client-behaviour-feature-request/46857/6 "2022-05-23T11:28:34Z")

</div>

After implementing a bunch of HTTP client behaviour modules for different projects and libraries I realised that vast majority of time we don’t need a module, all we need is a function. (Something to keep in mind for other things too.)

Here’s a signature:

```elixir
f(options) :: {:ok, %{status:, status, headers: headers, body: body}} | {:error, exception}

```

where `options` contains `:method`, `:url`, `:headers`, `:body` and other arbitrary adapter-specific keys.

And then we’d use it like this: `Foo.bar(http_request: &MyApp.http_request/1)`. And if we want to pass options at callsite we’d do: `http_request: {&MyApp.http_request/1, receive_timeout: 1000}`.

(It is pure accident that with next version of Req, an http client that I’m working on, it’d be: `http_request: &Req.request/1`. ;))

---

_[View the full topic](https://forum.elixirforum.com/t/standard-http-client-behaviour-feature-request/46857)._
