1 // Copyright (c) 2023 Huawei Device Co., Ltd. 2 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // you may not use this file except in compliance with the License. 4 // You may obtain a copy of the License at 5 // 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 //! HTTP synchronous client module. 15 //! 16 //! This module provides synchronous client components. 17 //! 18 //! - [`Client`]: The main part of client, which provides the request sending 19 //! interface and configuration interface. `Client` sends requests in a 20 //! synchronous blocking manner. 21 //! 22 //! - [`Connector`]: `Connector`s are used to create new connections 23 //! synchronously. This module provides `Connector` trait and a `HttpConnector` 24 //! which implements the trait. 25 26 // TODO: Reconstruct `sync_impl`, or reuse `async_impl`? 27 28 mod client; 29 mod conn; 30 mod connector; 31 mod http_body; 32 mod pool; 33 mod reader; 34 35 pub use client::{Client, ClientBuilder}; 36 pub use connector::Connector; 37 pub(crate) use connector::HttpConnector; 38 pub use http_body::HttpBody; 39 pub use reader::{BodyProcessError, BodyProcessor, BodyReader, DefaultBodyProcessor}; 40 pub use ylong_http::body::sync_impl::Body; 41 pub use ylong_http::body::{EmptyBody, TextBody}; 42 pub use ylong_http::request::Request; 43 pub use ylong_http::response::Response; 44 45 #[cfg(feature = "__tls")] 46 mod ssl_stream; 47 #[cfg(feature = "__tls")] 48 pub use ssl_stream::MixStream; 49