1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
// SPDX-FileCopyrightText: Politik im Blick developers // SPDX-FileCopyrightText: Wolfgang Silbermayr <wolfgang@silbermayr.at> // // SPDX-License-Identifier: AGPL-3.0-or-later OR EUPL-1.2 use http_request_derive_client_reqwest::ReqwestClientError; use pib_client_requests::body::post::Request; use pib_service_api_types::body::{by_id::get::ResponseBody, post::RequestBody}; use crate::{Authorization, Client}; impl Client { pub async fn body_post<A: Authorization + Sync>( &self, authorization: A, payload: RequestBody, ) -> Result<ResponseBody, ReqwestClientError> { Ok(self .execute_authorized(Request { payload }, authorization) .await? .0) } }