put

Function put 

Source
pub fn put(
    url: &str,
    headers: Option<HashMap<&str, &str>>,
    body: Option<&str>,
) -> Result<String, Box<dyn Error>>
Expand description

PUT Request

§Example

use light_tool::http;
assert_eq!(http::put("http://192.168.110.106:9900/api/v1/sys/node/dtu", None,
    Some("{\"dtu\": true, \"identity\": \"e540f857-704b-4985-bb69-3d6c935debb0\"}")).is_ok(), true)