httpipe icon indicating copy to clipboard operation
httpipe copied to clipboard

Register Before Execute

Open DavidAntaramian opened this issue 9 years ago • 0 comments

Should it be possible to register functions that should be called before a connection is executed in order to modify the request in some fashion?

The specification would look something like this, allowing for both anonymous functions and named functions:

@type before_execute_fun :: (HTTPipe.Request.t -> HTTPipe.Request.t)
@spec register_before_execute(HTTPipe.Conn.t, before_execute_fun) :: Conn.t
@spec register_before_execute(HTTPipe.Conn.t, module, atom) :: Conn.t

In the second case, the atom would refer to a single-arity function in the given module with a spec of (HTTPipe.Request.t) :: HTTPipe.Request.t.

DavidAntaramian avatar Sep 20 '16 05:09 DavidAntaramian