Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

javascript: switch do_rpc to Rpc.call -> Rpc.response

  • Loading branch information...
commit 2adaa550ca818fc2037cf08f313b8f672e5b95a4 1 parent bb2adaa
Dave Scott djs55 authored
Showing with 6 additions and 3 deletions.
  1. +5 −2 lib/rpc_client_js.ml
  2. +1 −1  lib/rpc_client_js.mli
7 lib/rpc_client_js.ml
View
@@ -1,9 +1,10 @@
open Lwt
open Js
-let do_rpc url contents =
+let do_rpc ~url call =
let method_ = "POST" in
let content_type = "text/xml" in
+ let contents = Xmlrpc.string_of_call call in
let (res, w) = Lwt.task () in
let req = XmlHttpRequest.create () in
@@ -16,7 +17,8 @@ let do_rpc url contents =
(fun _ ->
(match req##readyState with
| XmlHttpRequest.DONE ->
- Lwt.wakeup w
+ Lwt.wakeup w (Xmlrpc.response_of_string (Js.to_string req##responseText))
+(*
{XmlHttpRequest.url = url;
code = req##status;
content = Js.to_string req##responseText;
@@ -30,6 +32,7 @@ let do_rpc url contents =
else Some doc);
headers = fun _ -> None;
}
+*)
| _ -> ()));
req##send (Js.some (Js.string contents));
2  lib/rpc_client_js.mli
View
@@ -12,4 +12,4 @@
* GNU Lesser General Public License for more details.
*)
-val do_rpc : string -> string -> XmlHttpRequest.http_frame Lwt.t
+val do_rpc : url:string -> Rpc.call -> Rpc.response Lwt.t
Please sign in to comment.
Something went wrong with that request. Please try again.