package tdmrep

  1. Overview
  2. Docs

Module Tdmrep.HttpSource

TDM fields in HTTP responses.

A server may attach tdm-reservation and tdm-policy fields to a GET or HEAD response. These values override values obtained from the well-known file. The module does not depend on an HTTP library: pass extracted field values to Http.decode, or add the pairs returned by Http.encode to a response. See TDM fields in HTTP responses.

Sourceval reservation_name : string

reservation_name is "tdm-reservation".

Sourceval policy_name : string

policy_name is "tdm-policy".

Sourceval decode : reservation:string option -> policy:string option -> Declaration.t

decode ~reservation ~policy is the declaration carried by the field values, or raises Invalid_policy if policy is relative.

Sourceval encode : Declaration.t -> (string * string) list

encode declaration is the response fields for declaration.