pub struct HttpUtil;Expand description
http工具,此工具更多的用作reqwest的使用参考
Implementations§
Source§impl HttpUtil
impl HttpUtil
pub fn blocking_post(url: &str, body: String) -> Result<String, Box<dyn Error>>
pub async fn post_json( url: &str, body: HashMap<&str, &str>, ) -> Result<String, Box<dyn Error>>
pub async fn post_form( url: &str, form: Vec<(&str, &str)>, ) -> Result<String, Box<dyn Error>>
pub async fn request( method: Method, url: &str, headers: Vec<(&str, &str)>, body: &str, ) -> Result<String, Box<dyn Error>>
pub async fn post_bytes(url: &str, data: Vec<u8>) -> Result<(), Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for HttpUtil
impl RefUnwindSafe for HttpUtil
impl Send for HttpUtil
impl Sync for HttpUtil
impl Unpin 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