Code cleanup
This commit is contained in:
+5
-20
@@ -60,31 +60,16 @@ pub async fn send_mssage(
|
|||||||
);
|
);
|
||||||
|
|
||||||
let request = client.post(url).headers(headers).form(¶ms);
|
let request = client.post(url).headers(headers).form(¶ms);
|
||||||
|
|
||||||
match request.send().await {
|
match request.send().await {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
Ok(response)
|
match response.status() {
|
||||||
/*
|
reqwest::StatusCode::OK => {
|
||||||
match response
|
Ok(response)
|
||||||
.json::<crate::twilio::api::types::TwilioAPIMessage>()
|
|
||||||
.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)
|
|
||||||
}
|
}
|
||||||
Err(err) => {
|
status => {
|
||||||
Err(std::io::Error::other(err))
|
Err(std::io::Error::other(format!("Unaccounted status: {status:?}")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
Err(err) => Err(std::io::Error::other(err.to_string())),
|
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user