pub struct RequestResourceParams<'a> {
pub resource_url: &'a str,
pub access_token: &'a str,
pub token_type: Option<&'a str>,
pub retry: bool,
pub options: RequestResourceOptions<'a>,
}
Expand description
§RequestResourceParams
Fields§
§resource_url: &'a str
Resource server Url
access_token: &'a str
Access Token
token_type: Option<&'a str>
Type of the token
retry: bool
Specify if the request should be retried once
options: RequestResourceOptions<'a>
Implementations§
Source§impl<'a> RequestResourceParams<'a>
impl<'a> RequestResourceParams<'a>
Sourcepub fn resource_url(self, resource_url: &'a str) -> Self
pub fn resource_url(self, resource_url: &'a str) -> Self
Sets resource url
Sourcepub fn access_token(self, access_token: &'a str) -> Self
pub fn access_token(self, access_token: &'a str) -> Self
Sets access token
Sourcepub fn token_type(self, token_type: &'a str) -> Self
pub fn token_type(self, token_type: &'a str) -> Self
Sets token type
Sourcepub fn set_method(self, method: HttpMethod) -> Self
pub fn set_method(self, method: HttpMethod) -> Self
Set the resource request method
Sourcepub fn append_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn append_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Append a request header. If the value does not exist, a new value will be created.
Sourcepub fn set_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn set_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Set a request header
Sourcepub fn remove_header(self, name: &str) -> Self
pub fn remove_header(self, name: &str) -> Self
Remove a header with the name
Sourcepub fn use_bearer(self, bearer: bool) -> Self
pub fn use_bearer(self, bearer: bool) -> Self
Set if the request should use bearer auth
Sourcepub fn expect_json_body(self, expect: bool) -> Self
pub fn expect_json_body(self, expect: bool) -> Self
Expect the response body to be json
Sourcepub fn set_dpop_key(self, dpop: &'a Jwk) -> Self
pub fn set_dpop_key(self, dpop: &'a Jwk) -> Self
Set the dpop key
Trait Implementations§
Source§impl<'a> Default for RequestResourceParams<'a>
impl<'a> Default for RequestResourceParams<'a>
Source§fn default() -> RequestResourceParams<'a>
fn default() -> RequestResourceParams<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for RequestResourceParams<'a>
impl<'a> RefUnwindSafe for RequestResourceParams<'a>
impl<'a> Send for RequestResourceParams<'a>
impl<'a> Sync for RequestResourceParams<'a>
impl<'a> Unpin for RequestResourceParams<'a>
impl<'a> UnwindSafe for RequestResourceParams<'a>
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