def req.put.at
ezmcp@0.1.0.0 · src/openapi.bend:1169
import ezmcp@0.1.0.0/src/openapi.bend as Openapi
import Base
import emerging-ezjson@1.2.0.0/src/value.bend as Value
import emerging-ezhttp@0.21.0.0/src/http.bend as Http
import emerging-ezhttp@0.21.0.0/src/qs.bend as Qs
1169
1170
1171
1172
1173
1174def req.put.at(
1175 place: Place,
1176 +name: String,
1177 val: Value.Json,
1178 path: String,
1179 pairs: List<&2, Qs.Kv()>,
1180 hs: List<&2, Http.Header>
1181) -> Req:
1182 match place:
1183 case InPath{}:
1184 Req{fill(path, name, val), pairs, hs}
1185 case InQuery{}:
1186 Req{path, List.append(&2, Qs.Kv(), pairs, query(name, val)), hs}
1187 case InHeader{}:
1188 Req{path, pairs, List.append(&2, Http.Header, hs,
1189 [Http.H{String.to_lower(name), plain(val)}])}
1190 case InCookie{}:
1191 Req{path, pairs, hs}
1192 case InNone{}:
1193 Req{path, pairs, hs}