pub struct Request<'a> { /* private fields */ }Expand description
HTTP request data.
Implementations§
Source§impl<'a> Request<'a>
impl<'a> Request<'a>
Sourcepub fn builder(
url: impl Into<Cow<'a, str>>,
method: impl Into<Cow<'a, str>>,
headers: Headers,
initial_priority: impl Into<ResourcePriority>,
referrer_policy: impl Into<Cow<'a, str>>,
) -> RequestBuilder<'a>
pub fn builder( url: impl Into<Cow<'a, str>>, method: impl Into<Cow<'a, str>>, headers: Headers, initial_priority: impl Into<ResourcePriority>, referrer_policy: impl Into<Cow<'a, str>>, ) -> RequestBuilder<'a>
Creates a builder for this type with the required parameters:
url: Request URL (without fragment).method: HTTP request method.headers: HTTP request headers.initial_priority: Priority of the resource request at the time request is sent.referrer_policy: The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
Sourcepub fn url_fragment(&self) -> Option<&str>
pub fn url_fragment(&self) -> Option<&str>
Fragment of the requested URL starting with hash, if present.
Sourcepub fn has_post_data(&self) -> Option<bool>
pub fn has_post_data(&self) -> Option<bool>
True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
Sourcepub fn post_data_entries(&self) -> Option<&[PostDataEntry<'a>]>
pub fn post_data_entries(&self) -> Option<&[PostDataEntry<'a>]>
Request body elements (post data broken into individual entries).
Sourcepub fn mixed_content_type(&self) -> Option<&MixedContentType>
pub fn mixed_content_type(&self) -> Option<&MixedContentType>
The mixed content type of the request.
Sourcepub fn initial_priority(&self) -> &ResourcePriority
pub fn initial_priority(&self) -> &ResourcePriority
Priority of the resource request at the time request is sent.
Sourcepub fn referrer_policy(&self) -> &str
pub fn referrer_policy(&self) -> &str
The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
Sourcepub fn is_link_preload(&self) -> Option<bool>
pub fn is_link_preload(&self) -> Option<bool>
Whether is loaded via link preload.
Sourcepub fn trust_token_params(&self) -> Option<&TrustTokenParams<'a>>
pub fn trust_token_params(&self) -> Option<&TrustTokenParams<'a>>
Set for requests when the TrustToken API is used. Contains the parameters passed by the developer (e.g. via “fetch”) as understood by the backend.
Sourcepub fn is_same_site(&self) -> Option<bool>
pub fn is_same_site(&self) -> Option<bool>
True if this resource request is considered to be the ‘same site’ as the request corresponding to the main frame.
True when the resource request is ad-related.