conjure_runtime_raw/raw/
mod.rs

1// Copyright 2020 Palantir Technologies, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//! "Raw" HTTP client APIs.
15//!
16//! The [`conjure_runtime::Client`] wraps a raw HTTP client, which is used to handle the actual HTTP communication. A
17//! default raw client is provided, but this can be overridden if desired.
18//!
19//! # Behavior
20//!
21//! The raw client interacts directly with the [`http::Request`] and [`http::Response`] types, with a body type
22//! implementing the [`http_body::Body`] trait rather than using the [`AsyncBody`] type. The request's URI is provided in
23//! absolute-form, and all headers have already been set in the header map. The HTTP response should be
24//! returned directly, without any interpretation of the status code, handling of redirects, etc.
25//!
26//! A raw client is expected to implement `Service<Request<RawBody>, Response = Response<B>>`, where `B` implements the
27//! [`http_body::Body`] trait. The error type returned by the client must implement `Into<Box<dyn Error + Sync + Send>>`
28//! and be safe-loggable.
29//!
30//! Some configuration set in the [`Builder`] affects the raw client, including the connect timeout, security
31//! configuration, and proxy configuration. The default raw client respects these settings, but other implementations
32//! will need to handle them on their own.
33//!
34//! [`conjure_runtime::Client`]: crate::Client
35//! [`AsyncBody`]: conjure_http::client::AsyncBody
36pub use crate::raw::default::*;
37
38mod default;