pub struct Client { /* private fields */ }Implementations§
source§impl Client
impl Client
pub fn new() -> Self
pub async fn get_ticket( &self, uid: &str, password: &str ) -> Result<String, Box<dyn Error>>
pub async fn login_portal( &self, uid: &str, password: &str ) -> Result<&Self, Box<dyn Error>>
pub async fn login_lib( &self, uid: &str, password: &str ) -> Result<&Self, Box<dyn Error>>
pub async fn login_moodle( &self, uid: &str, password: &str ) -> Result<&Self, Box<dyn Error>>
Methods from Deref<Target = Session>§
Get the cookie store of this session.
store cookies manully
Methods from Deref<Target = Client>§
sourcepub fn get<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn get<U>(&self, url: U) -> RequestBuilderwhere U: IntoUrl,
Convenience method to make a GET request to a URL.
Errors
This method fails whenever the supplied Url cannot be parsed.
sourcepub fn post<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn post<U>(&self, url: U) -> RequestBuilderwhere U: IntoUrl,
Convenience method to make a POST request to a URL.
Errors
This method fails whenever the supplied Url cannot be parsed.
sourcepub fn put<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn put<U>(&self, url: U) -> RequestBuilderwhere U: IntoUrl,
Convenience method to make a PUT request to a URL.
Errors
This method fails whenever the supplied Url cannot be parsed.
sourcepub fn patch<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn patch<U>(&self, url: U) -> RequestBuilderwhere U: IntoUrl,
Convenience method to make a PATCH request to a URL.
Errors
This method fails whenever the supplied Url cannot be parsed.
sourcepub fn delete<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn delete<U>(&self, url: U) -> RequestBuilderwhere U: IntoUrl,
Convenience method to make a DELETE request to a URL.
Errors
This method fails whenever the supplied Url cannot be parsed.
sourcepub fn head<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn head<U>(&self, url: U) -> RequestBuilderwhere U: IntoUrl,
Convenience method to make a HEAD request to a URL.
Errors
This method fails whenever the supplied Url cannot be parsed.
sourcepub fn request<U>(&self, method: Method, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn request<U>(&self, method: Method, url: U) -> RequestBuilderwhere U: IntoUrl,
Start building a Request with the Method and Url.
Returns a RequestBuilder, which will allow setting headers and
the request body before sending.
Errors
This method fails whenever the supplied Url cannot be parsed.
sourcepub fn execute(
&self,
request: Request
) -> impl Future<Output = Result<Response, Error>>
pub fn execute( &self, request: Request ) -> impl Future<Output = Result<Response, Error>>
Executes a Request.
A Request can be built manually with Request::new() or obtained
from a RequestBuilder with RequestBuilder::build().
You should prefer to use the RequestBuilder and
RequestBuilder::send().
Errors
This method fails if there was an error while sending request, redirect loop was detected or redirect limit was exhausted.