pub fn fetch_json<'a>(&self,
                          func: &str,
                          msg: &str)
                          -> impl Future<Item = String, Error = Error> + 'a {
        println!("Send JSON: {}", msg);

        let mut header = List::new();
        header.append("Content-Type: application/json").unwrap();

        let mut a = Easy::new();
        a.http_headers(header).unwrap();
        a.post_fields_copy(msg.as_bytes()).unwrap();
        a.post(true).unwrap();

        self._fetch(func, a)
    }
/// Creates a new request and adds a JSON message to it. The returned Future contains a the
/// reply as a string.  This method should be used if no file is added because a JSON msg is
/// always compacter than a formdata one.
Creates a new request and adds a JSON message to it. The returned Future contains a the
reply as a string.  This method should be used if no file is added because a JSON msg is
always compacter than a formdata one.
Creates a new request and adds a JSON message to it . The returned Future contains a the reply as a string . This method should be used if no file is added because a JSON msg is always compacter than a formdata one .
pub fn fetch_json<'a>(&self,
                          func: &str,
                          msg: &str)
                          -> impl Future<Item = String, Error = Error> + 'a {
        println!("Send JSON: {}", msg);
        let mut header = List::new();
        header.append("Content-Type: application/json").unwrap();
        let mut a = Easy::new();
        a.http_headers(header).unwrap();
        a.post_fields_copy(msg.as_bytes()).unwrap();
        a.post(true).unwrap();
        self._fetch(func, a)
    }
pub fn fetch_json < ' a > ( & self , func : & str , msg : & str ) -> impl Future < Item = String , Error = Error > + ' a { println ! ( " " msg ) ; let mut header = List :: new ( ) ; header . append ( " " ) . unwrap ( ) ; let mut a = Easy :: new ( ) ; a . http_headers ( header ) . unwrap ( ) ; a . post_fields_copy ( msg . as_bytes ( ) ) . unwrap ( ) ; a . post ( true ) . unwrap ( ) ; self . _fetch ( func , a ) }
Creates a new request and adds a JSON message to it.
Creates a new request and adds a JSON message to it .
&self
func
&str
msg
&str