pub struct HttpUtil;Expand description
HTTP tool, which is mainly used as a reference for using reqwest
Implementations§
Source§impl HttpUtil
impl HttpUtil
pub fn blocking_post(url: &str, body: String) -> Result<String, Exception>
pub async fn post_json( url: &str, body: HashMap<&str, &str>, ) -> Result<String, Exception>
pub async fn post_form( url: &str, form: Vec<(&str, &str)>, ) -> Result<String, Exception>
pub async fn request( method: Method, url: &str, headers: Vec<(&str, &str)>, body: &str, ) -> Result<String, Exception>
pub async fn post_bytes(url: &str, data: Vec<u8>) -> Result<(), Exception>
Auto Trait Implementations§
impl Freeze for HttpUtil
impl RefUnwindSafe for HttpUtil
impl Send for HttpUtil
impl Sync for HttpUtil
impl Unpin for HttpUtil
impl UnsafeUnpin for HttpUtil
impl UnwindSafe for HttpUtil
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more