ocaml webmachine
v0.7.0
Ocaml-Webmachine是COHTTP顶部的一层,它实现了基于州机的HTTP请求处理器。它特别适合撰写Restful API。顾名思义,这是Webmachine项目的OCAML端口。
通过OPAM安装图书馆及其依赖:
opam install webmachineWebMachine实现了此决策图,以确定应如何处理HTTP请求。这包括验证,身份验证,内容谈判和缓存。资源通过在resource类中定义适当的方法来指定应在图中每个节点做出的决定。该通信是通过该方法的名称暂时建议的。将来将有更好的记录。
在examples/子目录中构建示例:
dune build examples/hello_lwt.exe
dune build examples/crud_lwt.exe
dune build examples/hello_async.exe要安装开发依赖性,请从存储库的根部固定包:
opam pin add -n webmachine .
opam install --deps-only webmachine之后,您可以使用安装命令照常安装库的开发版本。
对于在开发过程中构建和运行测试,您将需要安装oUnit软件包并运行测试:
opam install oUnit
dune runtestBSD3,请参阅其文本的许可证文件。