pub fn query<T: Serialize>(
        mut self,
        query: &T,
    ) -> Result<Self, serde_urlencoded::ser::Error> {
        let mut parts = self.head.uri.clone().into_parts();

        if let Some(path_and_query) = parts.path_and_query {
            let query = serde_urlencoded::to_string(query)?;
            let path = path_and_query.path();
            parts.path_and_query = format!("{}?{}", path, query).parse().ok();

            match Uri::from_parts(parts) {
                Ok(uri) => self.head.uri = uri,
                Err(e) => self.err = Some(e.into()),
            }
        }

        Ok(self)
    }
/// Sets the query part of the request
Sets the query part of the request
Sets the query part of the request
pub fn query<T: Serialize>(
        mut self,
        query: &T,
    ) -> Result<Self, serde_urlencoded::ser::Error> {
        let mut parts = self.head.uri.clone().into_parts();
        if let Some(path_and_query) = parts.path_and_query {
            let query = serde_urlencoded::to_string(query)?;
            let path = path_and_query.path();
            parts.path_and_query = format!("{}?{}", path, query).parse().ok();
            match Uri::from_parts(parts) {
                Ok(uri) => self.head.uri = uri,
                Err(e) => self.err = Some(e.into()),
            }
        }
        Ok(self)
    }
pub fn query < T : Serialize > ( mut self , query : & T , ) -> Result < Self , serde_urlencoded :: ser :: Error > { let mut parts = self . head . uri . clone ( ) . into_parts ( ) ; if let Some ( path_and_query ) = parts . path_and_query { let query = serde_urlencoded :: to_string ( query ) ? ; let path = path_and_query . path ( ) ; parts . path_and_query = format ! ( " " path query ) . parse ( ) . ok ( ) ; match Uri :: from_parts ( parts ) { Ok ( uri ) => self . head . uri = uri , Err ( e ) => self . err = Some ( e . into ( ) ) , } } Ok ( self ) }
Sets the query part of the request
Sets the query part of the request
mut self
query
&T
mut self
query
&T