def Conn.render

bend-kube-runtime@0.2.0.0 · src/client.bend:220

import bend-kube-runtime@0.2.0.0/src/client.bend as Client
import Base
import bend-kube-runtime@0.2.0.0/src/http.bend as H

220# The request's text, with the path under the server's base, our headers,
221# and Connection: keep-alive (pooled) or close, unless the request names
222# its own (an Upgrade).
223def Conn.render(req: H.Req, +base: String, +host: String, +token: String, keep: Bool) -> String:
224  match req:
225    case H.Req{m, path, +hs, body}:
226      H.Http.render(H.Req{m, base ++ path,
227        List.append(&2, H.Header, hs, List.append(&2, H.Header, Conn.auth(token),
228          Con{H.Header{"User-Agent", Conn.user_agent()},
229            Conn.connection(keep, Maybe.is_some(&2, String, H.Http.find(hs, "connection")))})),
230        body}, host)

Uses (13)

Used by (2)