An OCaml library for HTTP clients and servers

Description

Join the chat at https://gitter.im/mirage/ocaml-cohttp

Cohttp is an OCaml library for creating HTTP daemons. It has a portable HTTP parser, and implementations using various asynchronous programming libraries:

  • Cohttp_lwt_unix uses the Lwt library, and specifically the UNIX bindings.
  • Cohttp_async uses the Async library.
  • Cohttp_lwt exposes an OS-independent Lwt interface, which is used by the Mirage interface to generate standalone microkernels (see the mirage-http repository).
  • Cohttp_lwt_xhr compiles to a JavaScript module that maps the Cohttp calls to XMLHTTPRequests. This is used to compile OCaml libraries like the GitHub bindings to JavaScript and still run efficiently.

You can implement other targets using the parser very easily. Look at the IO signature in lib/s.mli and implement that in the desired backend.

You can activate some runtime debugging by setting COHTTP_DEBUG to any value, and all requests and responses will be written to stderr. Further debugging of the connection layer can be obtained by setting CONDUIT_DEBUG to any value.

Tags

org:mirage org:xapi-project

Published: 25 Jul 2017

Dependencies (17)

  1. alcotest with-test
  2. ounit with-test
  3. jsonm build
  4. logs
  5. fmt
  6. magic-mime
  7. base64 >= "2.0.0" & < "3.0.0"
  8. stringext
  9. ppx_sexp_conv >= "v0.9.0"
  10. ppx_fields_conv >= "v0.9.0"
  11. sexplib
  12. fieldslib
  13. uri >= "1.9.0" & < "2.0.0"
  14. re
  15. jbuilder >= "1.0+beta10"
  16. base-bytes
  17. ocaml >= "4.03.0" & < "4.06.0"

Reverse Dependencies (61)

  1. aws-async
  2. aws-lwt
  3. aws-s3 >= "2.0.0" & < "4.0.0"
  4. azblob-async
  5. azure-cosmos-db
  6. c3
  7. calculon-web < "0.5"
  8. canary
  9. cca >= "0.6.2"
  10. cohttp-async < "1.0.0" | >= "1.1.1" & < "2.2.0"
  11. cohttp-lwt < "1.0.0"
  12. cohttp-lwt-jsoo != "1.0.0" & < "1.1.1"
  13. cohttp-mirage >= "2.0.0" & != "2.1.1" & < "2.5.5"
  14. cohttp-top < "1.0.0" | >= "1.1.0" & < "2.2.0"
  15. comby-semantic
  16. cowabloga >= "0.0.9" & != "0.2.2"
  17. datakit < "0.10.0"
  18. dropbox >= "0.2"
  19. frenetic >= "3.3.0" & < "5.0.5"
  20. git = "1.4.10" | >= "1.5.0" & < "1.10.0"
  21. git-cohttp
  22. git-paf < "3.5.0"
  23. git-unix < "1.10.0"
  24. github >= "3.0.1" & < "4.4.0"
  25. github-jsoo >= "3.0.1" & < "4.4.0"
  26. github-unix >= "4.2.0" & < "4.4.0"
  27. hockmd
  28. imaplet-lwt >= "0.1.3"
  29. influxdb-async
  30. influxdb-lwt
  31. iocaml < "0.4.8"
  32. ip2location
  33. irmin >= "0.9.0" & != "0.11.1" & < "1.0.0"
  34. irmin-cli
  35. irmin-graphql >= "2.3.0"
  36. irmin-http >= "2.3.0"
  37. irmin-mirage-git >= "2.3.0" & < "2.8.0"
  38. irmin-unix < "0.9.9" | >= "2.3.0"
  39. letsencrypt < "0.3.0"
  40. links >= "0.7.3"
  41. magic-trace
  42. mechaml >= "1.0.0"
  43. merge-queues >= "0.2.0"
  44. mirage-http = "2.0.0" | >= "3.2.0"
  45. mirage-www >= "1.1.0"
  46. nsq >= "0.2.4"
  47. ocamlapi
  48. ojs-base >= "0.3.0" & < "0.6.0"
  49. opium = "0.13.3"
  50. opium_kernel
  51. podge
  52. ppx_json_types
  53. prof_spacetime = "0.2.0"
  54. prometheus-app = "0.4"
  55. quests
  56. session-cohttp
  57. sociaml-facebook-api >= "0.4.1"
  58. transmission-rpc
  59. webmachine >= "0.4.0" & < "0.6.0"
  60. websocket = "2.10"
  61. xen-api-client >= "0.9.8" & < "0.9.14"

Conflicts

    None