Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

send a Request.t #110

Merged
merged 1 commit into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@ let call t ~meth ?(headers = []) ?(body = Body.empty) target =

let request t ?headers ?body ~meth target = call t ?headers ?body ~meth target

let send t { Request.headers; body; meth; target; _ } =
call t ~headers:(Headers.to_list headers) ~body ~meth target

let head t ?headers target = call t ?headers ~meth:`HEAD target

let get t ?headers target = call t ?headers ~meth:`GET target
Expand Down
2 changes: 2 additions & 0 deletions lib/piaf.mli
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ module Client : sig
-> string
-> (Response.t, Error.t) Lwt_result.t

val send : t -> Request.t -> (Response.t, Error.t) Lwt_result.t

val shutdown : t -> unit Lwt.t
(** [shutdown t] tears down the connection [t] and frees up all the resources
associated with it. *)
Expand Down