| 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>, |