Skip to content

Add generic execute Request.t function to Cohttp_async.Client #281

@trevorsummerssmith

Description

@trevorsummerssmith

The current client interface does not allow one to exercise full control over the headers that are sent. This is limiting. For example, if one wants to send requests to the AWS S3 API one must create a signed hash the contains all headers prior to transmission. It is not possible to do this with the current, Client interface, because headers are added after the user's call. I could imagine other situations where it is desirable to construct a Request.t and then send it.

I would propose a call that takes a Request.t and executes it. I am happy to submit a pull request for this if you all like this idea. Suggested signature:

val call :
   ?interrupt:unit Deferred.t ->
   ?body:Body.t ->
   Request.t ->
   (Response.t * Body.t) Deferred.t

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions