Skip to main content

Method

Enum Method 

Source
pub enum Method {
Show 15 variants GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, TRACE, COPY, MOVE, MKCOL, PROPFIND, LOCK, UNLOCK,
}
Expand description

Supported HTTP Methods.

Variants§

§

GET

Requests a representation of the specified resource.

This is the most common method, used to Retrieve Data (like HTML, images, or JSON) from the server without modifying any state.

§

POST

Submits an entity to the specified resource.

Primarily used for Form Submissions or Data Uploads, often resulting in a change in state or side effects on the server.

§

PUT

Replaces all current representations of the target resource.

Used for Full Updates, where the client sends a complete version of the resource to overwrite the existing one.

§

PATCH

Applies partial modifications to a resource.

Ideal for Incremental Updates, allowing the client to modify only specific fields instead of replacing the entire object.

§

DELETE

Deletes the specified resource.

This method is used to Permanently Remove a file, database record, or other resource identified by the URI.

§

HEAD

Asks for a response identical to a GET request, but without the response body.

Extremely useful for Meta-data Checks, such as verifying file size or MIME type via headers before committing to a full download.

§

OPTIONS

Used to describe the communication options for the target resource.

Essential for CORS (Cross-Origin Resource Sharing), where browsers perform a “pre-flight” check to see which methods are permitted.

§

CONNECT

Establishes a tunnel to the server identified by the target resource.

Typically used for SSL/TLS Proxying, allowing secure communication to pass through intermediate servers.

§

TRACE

Performs a message loop-back test along the path to the target resource.

Primarily a Diagnostic Tool, it echoes back the received request so the client can see what changes proxies might be making.

§

COPY

Creates a duplicate of the source resource at the destination.

Primarily used in File Management to copy files or directories without downloading and re-uploading the data.

§

MOVE

Moves a resource from one URI to another.

Equivalent to a Rename or Cut-and-Paste operation on a remote file system.

§

MKCOL

Creates a new collection (folder/directory) at the specified location.

Used in WebDAV instead of POST or PUT to explicitly create directory structures.

§

PROPFIND

Retrieves properties (metadata) for a resource.

This is the most used WebDAV method. it allows the client to ask: “Is this a file or folder? What is its size? When was it modified?”

§

LOCK

Used to “lock” a resource to prevent overwrite conflicts.

Essential for Collaborative Editing, ensuring only one user can modify a file at a time.

§

UNLOCK

Removes a lock previously established by the LOCK method.

Replaces the resource in a “read-only” or “shared” state so other users can begin editing.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.