Page
Library
Module
Module type
Parameter
Class
Class type
Source
?backlog argument to the serve function (@samoht)sexplib0 for a more lightweight s-expression library (@mseri)Lwt_logs (#609 by @raphael-proust)cohttp.js META file.ppx_type_conv>=v0.9.1` due to a bug with duplicate modules present in earlier versions.mirage-http to cohttp-mirage` (#572)Header.is_empty (#576)-safe-string (#580, #581)Port build to jbuilder, and break up OPAM packages into multiple independent packages instead of being optional dependencies against the main cohttp package. This makes it significantly easier to depend on precisely the libraries you need, but requires porting applications to use the new ocamlfind and opam scheme.
The new package layout is:
cohttp: the main Cohttp modulecohttp-lwt: the portable Lwt implementationcohttp-lwt-unix: the Lwt/Unix implementationcohttp-lwt-jsoo: the js-of-ocaml JavaScript implementationcohttp-async: the Jane Street Async implementationmirage-http: the MirageOS compatible implementationcohttp-top: a toplevel printer for the Cohttp types.In each of these packages, the opam and ocamlfind package names are now the same, so you will need to rename the former subpackages such as cohttp.async to cohttp-async. The implementation is otherwise the same, so no other code changes should be required.
In return for these breaking changes to the packaging, it is now significantly easier to depend on a particular backend, also for us to rev the interfaces towards a stable 1.0 release. Jbuilder also builds the source tree around 4x faster than it did previously.
A number of deprecation warnings have been added to the source tree as well to mark the interfaces that will be removed in 1.0. These are Cohttp_lwt.{Client,Server,Net}, and a Cohttp_lwt.Body alias was added to deprecate the direct use of Cohttp_lwt_body. This will let us unify the namespaces of all the packages to use a single top-level module for each package in the future.
Most of the release and packaging work here was done by @rgrinberg and @avsm.
test_xhr.ml js_of_ocaml test.0.20.1 (2016-04-01)
0.20.0 (2016-03-25)
0.19.3 (2015-09-28):
printf (#431)-data-binary to send POST data. (#425)0.19.2 (2015-08-20):
0.19.1 (2015-08-08):
0.19.0 (2015-08-05): Compatibility breaking interface changes:
read_form from the Request/Response/Header interfaces as this should be done in Body handling instead (#401).New features and bug fixes:
IO.write_line as it was unused in any interfaces.lwt camlp4 extension. No observable external difference.Cohttp.Header.compare (#411)Cohttp_lwt.read_response now has a non-optional closefn parameter (#400).Cohttp_lwt_s module that contains all the Lwt module types in one convenient place (#397).0.18.3 (2015-07-12):
DELETE requests to have request bodies (#383).callv for HTTP/1.1 pipelined requests (#379 via Török Edwin).0.18.2 (2015-06-19):
0.18.1 (2015-06-05):
0.18.0 (2015-06-02):
Header.to_string (#362)Compatibility breaking interface changes:
Request/Response modules outside of Cohttp pack (#349)0.17.2 (2015-05-24):
make github target to push documentation to GitHub Pages (#338 from Jyotsna Prakash).0.17.1 (2015-04-24):
Cohttp.Conf.version with the library version number included.cohttp-curl-async.DESIGN.md document to explain the library structure.0.17.0 (2015-04-17):
Compatibility breaking interface changes:
CONNECT and TRACE methods added to Code.Exhaustive matches will need updating.New features and bug fixes:
Link header parsing has been added as Cohttp.Link, Header.get_links and Header.add_linkscohttp_server_* now obeys HEAD requests and responds 405 to unknown methodsCohttp_async.Server.response type is now exposed as a response * body paircohttp_curl_lwt -X HEAD sending empty chunked body (#313)\r\n in buffer at end of chunked readsCONNECT proxies (#308, #318)Host header when request-URI is absolute URIOPTIONS *)0.16.1 (2015-04-09): New features and bug fixes:
0.16.0 (2015-03-23):
Compatibility breaking interface changes:
post_form to be a string * string list instead of a Header.t (#257)Net signature which needs to be provided for Lwt servers to not be required. Only the Lwt client needs a Net functor argument to make outgoing connections. (#274)Request and Response records are no longer mutable, so use functional updates instead via Fieldslib.Field.fset Request.Fields.<field>. (#296)Request.has_body does not permit a body to be set for methods that RFC7231 forbids from having one (HEAD, GET and DELETE).New features and bug fixes:
cohttp-server-lwt to correctly bind to a specific interface (#298).Cohttp_async.request to send raw, unmodified requests.content-range or content-range header in any client request will always override any other encoding preference (#281).cohttp-lwt-proxy to act as an HTTP proxy. (#248)cohttp-server-async file server to work with HTTPS (#277).Uri.userinfo into the Authorization header for HTTP requests. (#255).install file to ensure that they are reliably uninstalled. (#252)magic-mime library to add a MIME type by probing filename during static serving in the Lwt/Async backends. (#260)Cohttp.Header.add_opt_unless_exists to set a header only if an override wasn't supplied, and to initialise a fresh Header value if none is present.post_form or redirect.Request.make does not inject a transfer-encoding header if there is no body present in the request (#246).Server.respond no longer overrides user-supplied headers that specify the content-length or transfer-encoding headers (#268).cohttp_server_lwt and cohttp_server_async now include sizes in directory listing titlesHeader.add_multi to initialise a header structure with multiple fields more efficiently (#272).IO.ic and IO.oc types for Cohttp_async (#271).Transfer_io.write (#270).read hangs if trying to fetch more than Sys.max_string_length (which can be triggered on 32-bit platforms). Read only a maximum that fits into a string (#282).cohttp-curl-lwt now takes http method as parameter (#288)0.15.2 (2015-02-15):
Cohttp.S.IO signature. (#233)Cohttp.Header.mem to check if a header exists.Cohttp.Conf module to expose the library version number. (#259)Cohttp.Header.add_unless_exists to update a key if it doesn't already exist. (#244)Cohttp.Header.get_location to retrieve redirection information. (#254)Net.lookup function to use Or_error.t instead of raising. (#247)content-range handling. (#249)0.15.1 (2015-01-10):
blit_bytes_string to blit_to_bytes, so depend on the newer API now. (#230)cmdliner in all of the Lwt client and server binaries. This gives cohttp-lwt-server a nice Unix-like command-line interface now that can be viewed with the --help option. (#218 via Runhang Li)oasis constraints and regenerate opam file (#229 via Christophe Troestler).0.15.0 (2014-12-24):
Compatibility breaking interface changes:
Cohttp_lwt_body.map to use a non-labelled type to fit the Lwt style better (#200).B64 as the toplevel module name (#220).New features and bug fixes:
Lwt_unix.run and replace it with Lwt_main.run. Should be no observable external change (#217).Cohttp.S signature (#221).0.14.0 (2014-12-18):
Compatibility breaking interface changes:
callback is no longer required (#210). Code that previous looked like: let conn_closed (_,conn_id) () = <...>
let config = { Server.callback; conn_closed } inshould now be:
let conn_closed (_,conn_id) = <...>
let config = Server.make ~callback ~conn_closed () inCohttp.Base64 module in favour of the external base64 library (which is now a new dependency).New features and bug fixes:
respond_error now defaults to an internal server error if no status code is specified (#212).opam file using the OPAM 1.2 workflow (#211).?flush optional parameter can still be explicitly set to false if flushing is not desired (#205).0.13.0 (2014-12-05):
Compatibility breaking interface changes:
Lwt client and server modules and module types.New features and bug fixes:
CONDUIT_TLS=native environment variable to make HTTPS requests using the pure OCaml TLS stack instead of depending on OpenSSL bindings. All of the installed binaries (client and server) can work in this mode.Cohttp_lwt_unix_debug which lets libraries control the debugging output from Cohttp. Previously the only way to do this was to set the COHTTP_DEBUG environment variable at the program start.cohttp-curl-lwt as a lightweight URI fetcher from the command-line. It uses the cmdliner as a new dependency.lwt.ssl for cohttp.lwt. This has been moved to conduit, so only lwt.unix is needed here now.0.12.0 (2014-11-07):
Compatibility breaking interface changes:
Cohttp.Auth.t to Cohttp.Auth.credential and Cohttp.Auth.req to Cohttp.Auth.challenge. Also expose an Other variant to make it more extensible for unknown authentication types. The Cohttp.Auth functions using these types have also been renamed accordingly.Cohttp.Transfer.encoding_to_string to string_of_encoding for consistency with the rest of Cohttp's APIs.has_body function in the Request and Response modules now explicitly signals when the body size is unknown.Cohttp.S.resolve_local_file in Cohttp_async and Cohttp_lwt now always percent-decode paths (#157)Cohttp_lwt.Server.server type synonym to t.Fixed encoding, we need to maintain state (bytes remaining) so we know when to finish. The Cohttp.Request and Cohttp.Response interfaces now expose a reader and writer types to track this safely.is_empty function to the Cohttp.S.Body module type.Strings representation to Cohttp.Body to efficiently hold a list of body chunks.Request and Response modules instead of individual Lwt and Async backends.New features and bugfixes:
Cohttp_lwt_xhr JavaScript backend that enables Cohttp logic to be mapped to XMLHTTPRequest in browsers via js_of_ocaml (via Andy Ray).Cohttp.String_io and String_io_lwt module that uses OCaml string or Buffer.t to read and write HTTP requests and responses instead of network connections.cohttp_server_lwt and cohttp_server_async now return better errors (#158)cohttp_server_lwt and cohttp_server_async now serve indexes directly (#162)stop thread to terminate a running server if it finishes (#147).Cohttp.Connection.compare to make ordering of connections possible.Body.map and Body.as_pipe to work with HTTP bodies more easily.cohttp_server_lwt and cohttp_server_async directory listings (#158)Cohttp_async.resolve_local_file directory traversal vulnerability (#158)return <const> with return_none, return_unit or return_nil.0.11.2 (2014-04-21)
0.11.1 (2014-04-17):
cohttp-server-lwt (#108).Cohttp.Connection.t now exposes sexp accessor functions (#117).0.11.0 (2014-04-01):
ocaml-re in order to make library POSIX thread-safe.0.10.0 (2014-03-02):
Request and Response module types now explicitly signal Eof and Invalid (for errors), to help the backend distinguish them.Cohttp.Body module. This is extended by Async/Lwt implementations with their specific ways of handling bodies (Pipes for Async, or Lwt_stream for Lwt).Server callback now always provides a body argument, since Cohttp_lwt_body now explicitly supports empty bodys.Cohttp.Header.is_keep_alive to test if a connection should be reused.keep-alive header in the server request handling.Body that takes a Pipe or a string, similarly to Lwt.cohttp-server binary even if tests are disabled.examples directory with some simple uses of the library.0.9.16 (2014-01-30):
Cohttp_lwt_unix so that Cohttp_lwt_unix.Server.Request.IO.ic can be equivalen to Lwt_io.input_channel.0.9.15 (2014-01-11):
Cohttp_mirage libraries, which have now moved to mirage/mirage-http-* on GitHub.Cookie attribute (#69).= in the values (#71).Max-age support for cookies (#70).Response record fields mutable to match the Request (#67).>> operator as it was unused and had incorrect precedence (#79).0.9.14 (2013-12-15):
cohttp-server binary that serves local directory contents via a web server (#54).flush function to the IO module type and implement in Lwt/Async/Mirage.flush support in the Async and Lwt responders (#52).TCP_NODELAY for Lwt/Unix server sockets for low-latency responses (#58).lib_test/README.md.body rather than a mandatory body option (#62).0.9.13 (2013-12-10):
cohttp.lwt-core is now installed as an OS-independent Lwt library.cohttp.mirage-unix and cohttp.mirage-xen.Cohttp.Connection module to manage server's connections identifiers.Accept_types module to the Cohttp pack.0.9.12 (2013-11-28):
Cohttp.Header.Cohttp types (#38).Cohttp.Set_cookie.t is no longer an abstract type to make it easier to update (#38).Cookie creation parameters for consistency (interface breaking, see #44).0.9.11 (2013-10-27):
0.9.10 (2013-06-21):
set-cookie header extraction functions for clients that read cookies.COHTTP_DEBUG env variable is set.0.9.9 (2013-06-12):
0.9.8 (2013-05-24):
Uri 1.3.8+ as it exposes the parameter query functions now removed from Request.Cohttp_async.body type alias and just use string Pipe.Reader.t for more explicit types.0.9.7 (2013-05-10):
0.9.6 (2013-03-18):
obuild support.0.9.5 (2012-12-29):
mirage-net 0.5.0 API (based on cstruct 0.6.0).0.9.4 (2012-12-19):
respond_redirect and respond_need_auth helpers.0.9.3 (2012-10-27):
Cohttp_lwt.Client.post_form now uses non-chunked encoding for the POST instead of chunked.put functions to HTTP PUT instead of POST.0.9.2 (2012-09-20):
0.9.1 (2012-09-11):
0.9.0 (2012-08-01):