Module Kurl.Bare

Bare URL requests.

type t = bare

See bare.

val v : ?ext:string -> ?query:Webs.Http.Query.t -> Webs.Http.Method.t -> Webs.Http.Path.t -> bare

See bare.

val method' : bare -> Webs.Http.Method.t

method' u is the HTTP method of u.

val path : bare -> Webs.Http.Path.t

path u is the URL path of u.

val query : bare -> Webs.Http.Query.t

query u is the URL query of u.

val ext : bare -> string

ext u is the optional URL path file extension of u. This is used by some URL formatting modes.

val with_path : Webs.Http.Path.t -> bare -> bare

with_path p b is b with path p.

val of_req : ?ext:string -> Webs.Http.Request.t -> bare

of_req ~ext r is a bare URL request from r. Bare.method' is Webs.Http.Request.method', Bare.path is Webs.Http.Request.path, Bare.query is parsed Webs.Http.Request.query, ext defaults to "".

val of_req_referer : ?ext:string -> ?method':Webs.Http.Method.t -> Webs.Http.Request.t -> (bare, string) Stdlib.result

of_req_referer ~ext r is a bare URL request from r. Bare.method' is meth (defaults to Webs.Http.Request.method' r), Bare.path and Bare.query are derived from the Webs.Http.Headers.referer header. The request service path is stripped from the path. Errors if r has no such header or if its parsing fails.

val pp : Stdlib.Format.formatter -> bare -> unit

pp ppf b formats an unspecified representation of b on ppf.