[−][src]Struct studentvue::request::WebHandle
Struct which manages and sends web requests asynchronously
Methods
impl WebHandle
[src]
pub async fn make_web_request<'_, R, M, S>(
uri: R,
method: M,
params: S,
headers: &'_ HeaderMap
) -> Result<Response, Error> where
R: AsRef<str>,
M: Into<Method>,
S: Serialize,
[src]
uri: R,
method: M,
params: S,
headers: &'_ HeaderMap
) -> Result<Response, Error> where
R: AsRef<str>,
M: Into<Method>,
S: Serialize,
Asynchronously sends a HTTP Request requiring manual parameters which returns a Response
Example
use studentvue::request::WebHandle; use reqwest::{ header::HeaderMap, Method, }; #[tokio::main] async fn main() -> Result<(), reqwest::Error> { let params: Vec<&str> = Vec::new(); let req = WebHandle::make_web_request("https://www.google.com", Method::POST, params, &HeaderMap::new()) .await?; println!("{:?}", req.status()); Ok(()) }
pub async fn send(
uri: impl AsRef<str>,
params: impl Serialize
) -> Result<String, Error>
[src]
uri: impl AsRef<str>,
params: impl Serialize
) -> Result<String, Error>
Asynchronously sends a POST request to the corresponding WebService endpoint or an optional url with specified parameters
Example
use studentvue::request::WebHandle; #[tokio::main] async fn main() -> Result<(), reqwest::Error> { let res = WebHandle::send("https://afsd.edupoint.com/Service/PXPCommunication.asmx/ProcessWebServiceRequest", &[("key", "value")]) .await?; Ok(()) }
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WebHandle
impl Send for WebHandle
impl Sync for WebHandle
impl Unpin for WebHandle
impl UnwindSafe for WebHandle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,