pub struct WebdavRequest { /* private fields */ }Expand description
Fluent builder for a WebDAV HTTP request.
Implementations§
Source§impl WebdavRequest
impl WebdavRequest
Sourcepub fn new(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
method: &str,
path: &str,
) -> Self
pub fn new( base_url: &Url, auth: &WebdavAuth, user_agent: &str, method: &str, path: &str, ) -> Self
Builds a request targeting path (relative to base_url) with
the given HTTP method. Sets Host from base_url and the
optional Authorization header from auth. user_agent is
emitted as the User-Agent header.
Sourcepub fn get(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn get( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a GET request.
Sourcepub fn delete(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn delete( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a DELETE request.
Sourcepub fn put(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn put( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a PUT request.
Sourcepub fn options(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn options( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds an OPTIONS request.
Sourcepub fn mkcol(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn mkcol( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a MKCOL request (RFC 4918 §9.3).
Sourcepub fn propfind(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn propfind( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a PROPFIND request (RFC 4918 §9.1).
Sourcepub fn proppatch(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn proppatch( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a PROPPATCH request (RFC 4918 §9.2).
Sourcepub fn report(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn report( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a REPORT request (RFC 3253 §3.6).
Sourcepub fn copy(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn copy( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a COPY request (RFC 4918 §9.8).
Sourcepub fn move(
base_url: &Url,
auth: &WebdavAuth,
user_agent: &str,
path: &str,
) -> Self
pub fn move( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self
Builds a MOVE request (RFC 4918 §9.9).
Sourcepub fn destination(self, destination: &str) -> Self
pub fn destination(self, destination: &str) -> Self
Sets the Destination header (RFC 4918 §10.3).
Sourcepub fn overwrite(self, overwrite: bool) -> Self
pub fn overwrite(self, overwrite: bool) -> Self
Sets the Overwrite header (RFC 4918 §10.6) to T or F.
Sourcepub fn if_match(self, etag: &str) -> Self
pub fn if_match(self, etag: &str) -> Self
Sets the If-Match header (RFC 9110 §13.1.1) to the given ETag.
Sourcepub fn if_none_match(self, etag: &str) -> Self
pub fn if_none_match(self, etag: &str) -> Self
Sets the If-None-Match header (RFC 9110 §13.1.2) to the given
ETag.
Sourcepub fn content_type(self, value: &str) -> Self
pub fn content_type(self, value: &str) -> Self
Sets the Content-Type header.
Sourcepub fn content_type_xml(self) -> Self
pub fn content_type_xml(self) -> Self
Shortcut for content_type("text/xml; charset=utf-8").
Sourcepub fn content_type_ical(self) -> Self
pub fn content_type_ical(self) -> Self
Shortcut for content_type("text/calendar; charset=utf-8").
Sourcepub fn content_type_vcard(self) -> Self
pub fn content_type_vcard(self) -> Self
Shortcut for content_type("text/vcard; charset=utf-8").
Sourcepub fn body(self, body: Vec<u8>) -> HttpRequest
pub fn body(self, body: Vec<u8>) -> HttpRequest
Finalizes the request with the given body and returns the
underlying HttpRequest ready for crate::rfc4918::send.
Trace-logs the body: WebDAV request bodies are always UTF-8 text (XML, iCalendar or vCard), so io-webdav can safely render them, whereas io-http (which cannot know the content type) does not.
Trait Implementations§
Source§impl Clone for WebdavRequest
impl Clone for WebdavRequest
Source§fn clone(&self) -> WebdavRequest
fn clone(&self) -> WebdavRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more