我想写一些代码来检索我的帐户状态从波纹API(https://ripple.com/wiki/JSON_Messages)。我正在使用的代码:OCamlnet和波纹API
#require "netclient";;
open Http_client.Convenience;;
let account_info =
[
("command","account_info");
("account","my_account_key")
]
;;
let response = http_post_message "http://s1.ripple.com:51234" account_info;;
我向http://s1.ripple.com:51234发送请求,并且收到错误的请求错误。注意:我已经尝试了方法和命令作为参数以及http_post和http_post_message方法。
# response#status;;
- : Http_client.status = `Client_error
# response#response_status;;
- : Nethttp.http_status = `Bad_request
我必须做一些根本性的错误,我请求数据,但我没有这个题材足够的经验知道这样我要去的地方错了。我认为也许我应该使用Http_client.post_raw方法,但是我的顶层不能识别这种方法。我不知道如何着手纠正我的错误。
# Http_client.post_raw;;
Error: Unbound value Http_client.post_raw
在此先感谢。
即使在浏览器中,您提供的URL也不会返回任何数据。 –