def headers

ezmcp@0.1.0.0 · src/client.bend:36

import ezmcp@0.1.0.0/src/client.bend as Client
import Base
import emerging-ezhttp@0.21.0.0/src/http.bend as Http

36# the headers of every POST: a JSON body, both reply types accepted, and
37# the negotiated revision once there is one (empty before initialize)
38def headers(+version: String) -> List<&2, Http.Header>:
39  Bool.pick(List<&2, Http.Header>, String.is_empty(version),
40    [Http.H{"Content-Type", "application/json"},
41      Http.H{"Accept", "application/json, text/event-stream"}],
42    [Http.H{"Content-Type", "application/json"},
43      Http.H{"Accept", "application/json, text/event-stream"},
44      Http.H{"MCP-Protocol-Version", version}])

Uses (5)

Used by (2)