package caldav

  1. Overview
  2. Docs
A CalDAV server

Install

Dune Dependency

Authors

Maintainers

Sources

caldav-0.2.3.tbz
sha256=47e8daa3246d42bab21696d7a81a8b2e5cf68551f64be440778d4ea70c4ec04a
sha512=881692617a96640dbaeff056bccd3ef57aa06baaae2cd2faaaf7adf76b0c0bcd0a573ab348185064e1a40cf8bc44660c4f0891d9e259b48ccb55847774890854

doc/caldav.webmachine/Webmachine/Rd/index.html

Module Webmachine.RdSource

The Rd module is the means by which handlers access and manipulate request-specific information.

Sourcetype 'body t = {
  1. version : Cohttp.Code.version;
  2. meth : Cohttp.Code.meth;
  3. uri : Uri.t;
  4. req_headers : Cohttp.Header.t;
  5. req_body : 'body;
  6. resp_headers : Cohttp.Header.t;
  7. resp_body : 'body;
  8. resp_redirect : bool;
  9. dispatch_path : string;
  10. path_info : (string * string) list;
} constraint 'body = [> `Empty ]
Sourceval make : ?dispatch_path:string -> ?path_info:(string * string) list -> ?resp_headers:Cohttp.Header.t -> ?resp_body:'a -> ?resp_redirect:bool -> ?req_body:'a -> request:Cohttp.Request.t -> unit -> 'a t

make ~request () returns a 'body t with the following fields pouplated from the request argument:

  • uri;
  • version;
  • meth; and
  • req_headers

All other fields will be populated with default values unless they are provided as optional arguments

Sourceval with_req_headers : (Cohttp.Header.t -> Cohttp.Header.t) -> 'a t -> 'a t

with_req_headers f t is equivalent to { t with req_headers = f (t.req_headers) }

Sourceval with_resp_headers : (Cohttp.Header.t -> Cohttp.Header.t) -> 'a t -> 'a t

with_resp_headers f t is equivalent to { t with resp_headers = f (t.resp_headers) }

Sourceval lookup_path_info : string -> 'a t -> string option
Sourceval lookup_path_info_exn : string -> 'a t -> string

lookup_path_info_exn k t is equivalent List.assoc k t.path_info, which will throw a Not_found exception if the lookup fails. The non-_exn version will return an optional result.

Sourceval redirect : string -> 'a t -> 'a t

redirect location t sets the resp_redirect bit in t and sets the Location response header to location.

OCaml

Innovation. Community. Security.