package shuttle_http

  1. Overview
  2. Docs
Async library for HTTP/1.1 servers and clients

Install

dune-project
 Dependency

Authors

Maintainers

Sources

shuttle-0.9.0.tbz
sha256=fd61626c46dcbd63449746b55e1b0821119e5215c6b32330f9671fbb306812ef
sha512=f06946e9271acd8df613385f7b94facb3d807b031c7eb21fac30886db0f45d8615b6eb71132455008b746513de3590d77890518e0c1a2672f1434cd9c1d97f67

doc/src/shuttle_http/request.ml.html

Source file request.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
open Core

type t =
  { meth : Meth.t
  ; path : string
  ; version : Version.t
  ; headers : Headers.t
  ; body : Body.t
  }
[@@deriving sexp_of]

let create
  ?(version = Version.Http_1_1)
  ?(headers = Headers.empty)
  ?(body = Body.empty)
  meth
  path
  =
  { meth; path; version; headers; body }
;;

let meth t = t.meth
let path t = t.path
let version t = t.version
let headers t = t.headers
let body t = t.body
let with_body t body = if phys_equal t.body body then t else { t with body }

let with_headers t headers =
  if phys_equal t.headers headers then t else { t with headers }
;;