Sign in

    moonbitstack/moonhttp/method does not have a README file

    Refused

    pub(all) suberror Refused {
    Token(String)
    } derive(Eq,
    Debug
    )

    Why a name is not a method.

    Refused::equal

    fn Refused::equal(Refused, Refused) -> Bool

    Refused::not_equal

    fn Refused::not_equal(x : Refused, y : Refused) -> Bool

    Refused::to_repr

    Method

    pub(all) enum Method {
    Get
    Head
    Post
    Put
    Delete
    Connect
    Options
    Trace
    Patch
    Other(String)
    } derive(Eq,
    Debug
    )

    A request method (RFC 9110 ยง9.1). The eight of RFC 9110 and PATCH (RFC 5789) have their own constructors; any other token is Other.

    Method names are case-sensitive, so get is an extension method and not Get. Build a method from its name with Method::of, which picks the constructor: Other("GET") written by hand is not equal to Get.

    Method::equal

    fn Method::equal(Method, Method) -> Bool

    Method::is_idempotent

    fn Method::is_idempotent(self : Method) -> Bool

    Whether sending the request twice has the effect of sending it once (RFC 9110 ยง9.2.2), so a client may retry it after a connection fails before the response arrives. An extension method is not assumed idempotent.

    Method::is_safe

    fn Method::is_safe(self : Method) -> Bool

    Whether the method is read-only (RFC 9110 ยง9.2.1), so a crawler, a prefetch or a cache may send it without the user asking. An extension method is not assumed safe.

    Method::name

    fn Method::name(self : Method) -> String

    The name sent on the request line or in :method.

    Method::not_equal

    fn Method::not_equal(x : Method, y : Method) -> Bool

    Method::of

    fn Method::of(name : StringView) -> Method raise Refused

    The method named name.

    Method::to_repr

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    ยฉ 2026 mooncakes.io