packages

http::method

On this page

Request methods (RFC 9110).

Structs

MethodSource

pub struct Method

A request method. Methods are case-sensitive tokens; the standard ones are constants (Method::GET), others come from parse.

  • pub const GET: Method = Method { name: "GET" }§

    Source
  • pub const HEAD: Method = Method { name: "HEAD" }§

    Source
  • pub const POST: Method = Method { name: "POST" }§

    Source
  • pub const PUT: Method = Method { name: "PUT" }§

    Source
  • pub const DELETE: Method = Method { name: "DELETE" }§

    Source
  • pub const CONNECT: Method = Method { name: "CONNECT" }§

    Source
  • pub const OPTIONS: Method = Method { name: "OPTIONS" }§

    Source
  • pub const TRACE: Method = Method { name: "TRACE" }§

    Source
  • pub const PATCH: Method = Method { name: "PATCH" }§

    Source
  • pub fn parse(s: str) throws (HttpError) -> Method§

    Source

    Any token is a method; anything else is an error.

  • pub fn as_str(self) -> str§

    Source
  • pub fn is_safe(self) -> bool§

    Source

    GET, HEAD, OPTIONS, TRACE.

  • pub fn is_idempotent(self) -> bool§

    Source

    The safe methods plus PUT and DELETE.

Trait implementations 2
  • impl Display for Method
  • impl Debug for Method