diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index 0000b67..edeccd5 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -60,31 +60,16 @@ pub async fn send_mssage( ); let request = client.post(url).headers(headers).form(¶ms); - match request.send().await { Ok(response) => { - Ok(response) - /* - match response - .json::() - .await - { - Ok(resp) => Ok(resp), - Err(err) => Err(std::io::Error::other(err)), - } - match response.text().await { - Ok(body) => { - let mut obj = crate::twilio::api::types::TwilioAPIMessage { - ..Default::default() - }; - - Ok(obj) + match response.status() { + reqwest::StatusCode::OK => { + Ok(response) } - Err(err) => { - Err(std::io::Error::other(err)) + status => { + Err(std::io::Error::other(format!("Unaccounted status: {status:?}"))) } } - */ } Err(err) => Err(std::io::Error::other(err.to_string())), }