pub fn header<K, V>(mut self, key: K, value: V) -> Self
    where
        HeaderName: TryFrom<K>,
        <HeaderName as TryFrom<K>>::Error: fmt::Debug + Into<HttpError>,
        V: header::IntoHeaderValue,
        V::Error: fmt::Debug,
    {
        match HeaderName::try_from(key) {
            Ok(key) => match value.try_into_value() {
                Ok(value) => {
                    self.headers.append(key, value);
                }
                Err(e) => log::error!("Header value error: {:?}", e),
            },
            Err(e) => log::error!("Header name error: {:?}", e),
        }
        self
    }
/// Add default header. Headers added by this method
/// get added to every request.
Add default header. Headers added by this method
get added to every request.
Add default header . Headers added by this method get added to every request .
pub fn header<K, V>(mut self, key: K, value: V) -> Self
    where
        HeaderName: TryFrom<K>,
        <HeaderName as TryFrom<K>>::Error: fmt::Debug + Into<HttpError>,
        V: header::IntoHeaderValue,
        V::Error: fmt::Debug,
    {
        match HeaderName::try_from(key) {
            Ok(key) => match value.try_into_value() {
                Ok(value) => {
                    self.headers.append(key, value);
                }
                Err(e) => log::error!("Header value error: {:?}", e),
            },
            Err(e) => log::error!("Header name error: {:?}", e),
        }
        self
    }
pub fn header < K , V > ( mut self , key : K , value : V ) -> Self where HeaderName : TryFrom < K > , < HeaderName as TryFrom < K > > :: Error : fmt :: Debug + Into < HttpError > , V : header :: IntoHeaderValue , V :: Error : fmt :: Debug , { match HeaderName :: try_from ( key ) { Ok ( key ) => match value . try_into_value ( ) { Ok ( value ) => { self . headers . append ( key , value ) ; } Err ( e ) => log :: error ! ( " " e ) , } , Err ( e ) => log :: error ! ( " " e ) , } self }
Add default header.
Add default header .
mut self
key
K
value
V
mut self
key
K
value
V