pub fn pick_method(&self) -> Method {
        if self.body_type == BodyType::Multipart {
            return Method::POST;
        }
        for item in &self.items {
            match item {
                RequestItem::HttpHeader(..)
                | RequestItem::HttpHeaderToUnset(..)
                | RequestItem::UrlParam(..) => continue,
                RequestItem::DataField(..)
                | RequestItem::DataFieldFromFile(..)
                | RequestItem::JsonField(..)
                | RequestItem::JsonFieldFromFile(..)
                | RequestItem::FormFile { .. } => return Method::POST,
            }
        }
        Method::GET
    }
/// Guess which HTTP method would be appropriate for the return value of `body`.
///
/// It's better to use `Body::pick_method`, if possible. This method is
/// for the benefit of `to_curl`, which sometimes has to process the
/// request items itself.
Guess which HTTP method would be appropriate for the return value of `body`.
It's better to use `Body::pick_method`, if possible. This method is
for the benefit of `to_curl`, which sometimes has to process the
request items itself.
Guess which HTTP method would be appropriate for the return value of ` body ` . It ' s better to use ` Body :: pick_method ` if possible . This method is for the benefit of ` to_curl ` which sometimes has to process the request items itself .
pub fn pick_method(&self) -> Method {
        if self.body_type == BodyType::Multipart {
            return Method::POST;
        }
        for item in &self.items {
            match item {
                RequestItem::HttpHeader(..)
                | RequestItem::HttpHeaderToUnset(..)
                | RequestItem::UrlParam(..) => continue,
                RequestItem::DataField(..)
                | RequestItem::DataFieldFromFile(..)
                | RequestItem::JsonField(..)
                | RequestItem::JsonFieldFromFile(..)
                | RequestItem::FormFile { .. } => return Method::POST,
            }
        }
        Method::GET
    }
pub fn pick_method ( & self ) -> Method { if self . body_type == BodyType :: Multipart { return Method :: POST ; } for item in & self . items { match item { RequestItem :: HttpHeader ( .. ) | RequestItem :: HttpHeaderToUnset ( .. ) | RequestItem :: UrlParam ( .. ) => continue , RequestItem :: DataField ( .. ) | RequestItem :: DataFieldFromFile ( .. ) | RequestItem :: JsonField ( .. ) | RequestItem :: JsonFieldFromFile ( .. ) | RequestItem :: FormFile { .. } => return Method :: POST , } } Method :: GET }
Guess which HTTP method would be appropriate for the return value of `body`.
Guess which HTTP method would be appropriate for the return value of ` body ` .
&self
&self