2 * http://www.ocsigen.org
3 * Module http_headers.mli
4 * Copyright (C) 2007 Jérôme Vouillon
5 * Laboratoire PPS - CNRS Université Paris Diderot
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, with linking exception;
10 * either version 2.1 of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 (*XXX Can have multiple headers with the same name...*)
26 val name
: string -> name
27 val name_to_string
: name
-> string
29 module NameHtbl
: Hashtbl.S
with type key
= name
34 val accept_charset
: name
35 val accept_encoding
: name
36 val accept_language
: name
37 val accept_ranges
: name
38 val cache_control
: name
40 val content_encoding
: name
41 val content_length
: name
42 val content_type
: name
43 val content_range
: name
50 val if_modified_since
: name
51 val if_none_match
: name
52 val if_unmodified_since
: name
54 val last_modified
: name
59 val transfer_encoding
: name
69 (** returns an empty set of HTTP headers *)
71 val add
: name
-> string -> t
-> t
72 (** [add name s h] adds the header [name: s] to [h]. *)
74 val replace
: name
-> string -> t
-> t
75 (** replace a header by another one. If it does not exist, adds it. *)
77 val replace_opt
: name
-> string option -> t
-> t
78 (** replace or remove a header. *)
80 val find
: name
-> t
-> string
81 (** find one of the values bound to [name] in the HTTP header [t].
82 Raise [Not_found] if it is not bound.
85 val find_all
: name
-> t
-> string list
86 (** find all the values bound to [name] in the HTTP header [t]. *)
88 val iter
: (name
-> string -> unit) -> t
-> unit
89 val fold
: (name
-> string list
-> 'a
-> 'a
) -> t
-> 'a
-> 'a
91 val with_defaults
: t
-> t
-> t
92 (** [with_defaults h1 h2] adds headers from [h1] to [h2].
93 If some headers were present, the are replaced by those from [h1].
98 (** Headers for dynamic pages (non cachable) *)