put

Function put 

Source
pub fn put<E: Encode>(
    url: impl Into<String>,
    headers: impl IntoIterator<Item = (String, String)>,
    body: E,
) -> Result<Response, HttpPutError<E::Error>>
Expand description

HTTP PUT

http::put("https://gomomento.com", [], b"hello".as_ref())?;

use momento_functions_host::encoding::Json;
#[derive(serde::Serialize)]
struct MyStruct {
    message: String
}

http::put(
    "https://gomomento.com",
    [
        ("authorization".to_string(), "abc123".to_string()),
    ],
    Json(MyStruct { message: "hello".to_string() })
)?;