MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / query_http_api

Function query_http_api

src/environmentd/tests/auth.rs:256–278  ·  view source on GitHub ↗
(
                    query: &str,
                    uri: &Uri,
                    headers: &'a HeaderMap,
                    configure: &Box<
                        dyn Fn(&mut SslConnectorBuild

Source from the content-addressed store, hash-verified

254 assert,
255 } => {
256 async fn query_http_api<'a>(
257 query: &str,
258 uri: &Uri,
259 headers: &'a HeaderMap,
260 configure: &Box<
261 dyn Fn(&mut SslConnectorBuilder) -> Result<(), ErrorStack> + 'a,
262 >,
263 ) -> Result<Response<Incoming>, hyper_util::client::legacy::Error> {
264 hyper_util::client::legacy::Client::builder(TokioExecutor::new())
265 .build(make_http_tls(configure))
266 .request({
267 let mut req = Request::post(uri);
268 for (k, v) in headers.iter() {
269 req.headers_mut().unwrap().insert(k, v.clone());
270 }
271 req.headers_mut().unwrap().insert(
272 "Content-Type",
273 HeaderValue::from_static("application/json"),
274 );
275 req.body(json!({ "query": query }).to_string()).unwrap()
276 })
277 .await
278 }
279
280 async fn assert_success_response(
281 res: Result<Response<Incoming>, hyper_util::client::legacy::Error>,

Callers 1

run_testsFunction · 0.85

Calls 8

make_http_tlsFunction · 0.85
unwrapMethod · 0.80
buildMethod · 0.45
iterMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45
bodyMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected