pub fn append_header<H>(&mut self, header: H) -> &mut Self
    where
        H: IntoHeaderPair,
    {
        if let Some(parts) = self.inner() {
            match header.try_into_header_pair() {
                Ok((key, value)) => parts.headers.append(key, value),
                Err(e) => self.err = Some(e.into()),
            };
        }

        self
    }
/// Append a header, keeping any that were set with an equivalent field name.
///
/// # Examples
/// ```
/// use actix_http::{ResponseBuilder, http::header};
///
/// let res = ResponseBuilder::default()
///     .append_header((header::CONTENT_TYPE, mime::APPLICATION_JSON))
///     .append_header(("X-TEST", "value1"))
///     .append_header(("X-TEST", "value2"))
///     .finish();
///
/// assert_eq!(res.headers().get_all("content-type").count(), 1);
/// assert_eq!(res.headers().get_all("x-test").count(), 2);
/// ```
Append a header, keeping any that were set with an equivalent field name.
Append a header keeping any that were set with an equivalent field name .
pub fn append_header<H>(&mut self, header: H) -> &mut Self
    where
        H: IntoHeaderPair,
    {
        if let Some(parts) = self.inner() {
            match header.try_into_header_pair() {
                Ok((key, value)) => parts.headers.append(key, value),
                Err(e) => self.err = Some(e.into()),
            };
        }
        self
    }
pub fn append_header < H > ( & mut self , header : H ) -> & mut Self where H : IntoHeaderPair , { if let Some ( parts ) = self . inner ( ) { match header . try_into_header_pair ( ) { Ok ( ( key , value ) ) => parts . headers . append ( key , value ) , Err ( e ) => self . err = Some ( e . into ( ) ) , } ; } self }
Append a header, keeping any that were set with an equivalent field name.
Append a header keeping any that were set with an equivalent field name .
&mut self
header
H
&mut self
header
H
examples
```
use actix_http::{ResponseBuilder, http::header}.

let res = ResponseBuilder::default()
.append_header((header::CONTENT_TYPE, mime::APPLICATION_JSON))
.append_header(("X-TEST", "value1"))
.append_header(("X-TEST", "value2"))
.finish().


` ` ` use actix_http :: { ResponseBuilder http :: header } . let res = ResponseBuilder :: default () . append_header (( header :: CONTENT_TYPE mime :: APPLICATION_JSON )) . append_header (( " X - TEST " " value1 " )) . append_header (( " X - TEST " " value2 " )) . finish () .