Enum front_line::Method
source · pub enum Method {
Get,
Post,
Put,
Delete,
Head,
Options,
Connect,
Trace,
Patch,
}
Expand description
Represents HTTP methods.
These methods are tokens that indicate the desired action to be performed on the identified resource.
Variants§
Get
Represents the HTTP GET
method.
Used to retrieve data from a server.
Post
Represents the HTTP POST
method.
Used to submit data to a server for processing.
Put
Represents the HTTP PUT
method.
Used to update a resource or create a new resource if it does not exist.
Delete
Represents the HTTP DELETE
method.
Used to delete a resource.
Head
Represents the HTTP HEAD
method.
Used to retrieve metadata about a resource.
Options
Represents the HTTP OPTIONS
method.
Used to describe the communication options for the target resource.
Connect
Represents the HTTP CONNECT
method.
Used to establish a network connection for a given URI.
Trace
Represents the HTTP TRACE
method.
Used for diagnostic purposes.
Patch
Represents the HTTP PATCH
method.
Used to apply partial modifications to a resource.
Implementations§
source§impl Method
impl Method
sourcepub fn parse(request_line: &[u8]) -> Option<(Method, &[u8])>
pub fn parse(request_line: &[u8]) -> Option<(Method, &[u8])>
Parse an HTTP request line to determine the method.
This function will attempt to parse the provided request line slice and return the identified HTTP method and the remaining part of the request line.
Arguments
request_line
- A byte slice containing the request line to parse.
Returns
Returns Some((Method, &[u8]))
if a valid HTTP method is found. Otherwise,
returns None
.