Skip to content
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: 1 addition & 2 deletions js/cohttp_lwt_xhr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ end) = struct

let post_form ?ctx ?headers ~params uri =
let headers = C.Header.add_opt headers "content-type" "application/x-www-form-urlencoded" in
let q = List.map (fun (k,v) -> k, [v]) (C.Header.to_list params) in
let body = Cohttp_lwt_body.of_string (Uri.encoded_of_query q) in
let body = Cohttp_lwt_body.of_string (Uri.encoded_of_query params) in
post ?ctx ~chunked:false ~headers ~body uri

(* No implementation (can it be done?). What should the failure exception be? *)
Expand Down
5 changes: 2 additions & 3 deletions lwt/cohttp_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module type Client = sig
val post_form :
?ctx:ctx ->
?headers:Cohttp.Header.t ->
params:Cohttp.Header.t ->
params:(string * string list) list ->
Uri.t -> (Response.t * Cohttp_lwt_body.t) Lwt.t

val callv :
Expand Down Expand Up @@ -184,8 +184,7 @@ module Make_client

let post_form ?ctx ?headers ~params uri =
let headers = Header.add_opt headers "content-type" "application/x-www-form-urlencoded" in
let q = List.map (fun (k,v) -> k, [v]) (Header.to_list params) in
let body = Cohttp_lwt_body.of_string (Uri.encoded_of_query q) in
let body = Cohttp_lwt_body.of_string (Uri.encoded_of_query params) in
post ?ctx ~chunked:false ~headers ~body uri

let callv ?(ctx=default_ctx) uri reqs =
Expand Down
2 changes: 1 addition & 1 deletion lwt/cohttp_lwt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module type Client = sig
val post_form :
?ctx:ctx ->
?headers:Cohttp.Header.t ->
params:Cohttp.Header.t ->
params:(string * string list) list ->
Uri.t -> (Response.t * Cohttp_lwt_body.t) Lwt.t

val callv :
Expand Down