1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
open Core
type t =
{ version : Version.t
; status : Status.t
; reason_phrase : string
; : Headers.t
}
[@@deriving sexp]
let create ?(version = Version.Http_1_1) ?reason_phrase ?( = Headers.empty) status =
let reason_phrase = Option.value reason_phrase ~default:(Status.to_string status) in
{ version; status; reason_phrase; headers }
;;
let version t = t.version
let status t = t.status
let reason_phrase t = t.reason_phrase
let t = t.headers