package ocsigenserver
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A full-featured and extensible Web server
Install
dune-project
Dependency
Authors
Maintainers
Sources
6.0.0.tar.gz
md5=001e22ec2da3ab08840f934a8f005859
sha512=59f36fdf0a640117aa562d1d9ef96b7146843d9b72d71d01366640521405550074e03267fb388c5e685542781fc4bce763818a36cf05c0e033fae5e51c2f1496
doc/src/ocsigenserver/ocsigen_response.ml.html
Source file ocsigen_response.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94type t = { a_response : Cohttp.Response.t ; a_body : Cohttp_lwt.Body.t ; a_cookies : Ocsigen_cookie_map.t } let make ?(body = Cohttp_lwt.Body.empty) ?( = Ocsigen_cookie_map.empty) a_response = {a_response; a_body = body; a_cookies = cookies} let update ?response ?body ? {a_response; a_body; } = let a_response = match response with Some response -> response | None -> a_response and a_body = match body with Some body -> body | None -> a_body and = match cookies with Some -> cookies | None -> a_cookies in {a_response; a_body; a_cookies} let of_cohttp ?( = Ocsigen_cookie_map.empty) (a_response, a_body) = {a_response; a_body; a_cookies = cookies} let to_cohttp {a_response; a_body; _} = a_response, a_body let status {a_response = {Cohttp.Response.status; _}; _} = match status with | `Code _ -> failwith "FIXME: Cohttp.Code.status_code -> status" | #Cohttp.Code.status as a -> a let set_status ({a_response; _} as a) status = { a with a_response = {a_response with Cohttp.Response.status :> Cohttp.Code.status_code} } let {; _} = a_cookies let ({; _} as a) = if cookies = Ocsigen_cookie_map.empty then a else {a with a_cookies = Ocsigen_cookie_map.add_multi a_cookies cookies} let header {a_response; _} id = let h = Cohttp.Response.headers a_response in Cohttp.Header.get h (Ocsigen_header.Name.to_string id) let header_multi {a_response; _} id = let h = Cohttp.Response.headers a_response in Cohttp.Header.get_multi h (Ocsigen_header.Name.to_string id) let add_header ({a_response = {Cohttp.Response.headers; _} as a_response; _} as a) id v = { a with a_response = { a_response with Cohttp.Response.headers = Cohttp.Header.add headers (Ocsigen_header.Name.to_string id) v } } let add_header_multi ({a_response = {Cohttp.Response.headers; _} as a_response; _} as a) id l = let id = Ocsigen_header.Name.to_string id in let headers = List.fold_left (fun headers -> Cohttp.Header.add headers id) headers l in {a with a_response = {a_response with Cohttp.Response.headers}} let replace_header ({a_response = {Cohttp.Response.headers; _} as a_response; _} as a) id v = { a with a_response = { a_response with Cohttp.Response.headers = Cohttp.Header.replace headers (Ocsigen_header.Name.to_string id) v } } let replace_headers ({a_response; _} as a) l = let headers = List.fold_left (fun headers (id, content) -> Cohttp.Header.replace headers (Ocsigen_header.Name.to_string id) content) (Cohttp.Response.headers a_response) l in {a with a_response = {a_response with Cohttp.Response.headers}} let remove_header ({a_response; _} as a) id = let headers = Cohttp.Response.headers a_response and id = Ocsigen_header.Name.to_string id in let headers = Cohttp.Header.remove headers id in {a with a_response = {a_response with Cohttp.Response.headers}}
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>