http-rs / http-types

Common types for HTTP operations
https://docs.rs/http-types
Apache License 2.0
200 stars 83 forks source link

The `Method` enum should support all the registered HTTP methods #331

Closed zenekron closed 3 years ago

zenekron commented 3 years ago

TL;DR: the Method enum only supports fraction of all the registered HTTP methods.

EDIT: I've currently opened the PR #332 to resolve this issue.

About Mozilla's documentation

Mozilla's HTTP request methods only contains information about the methods specified in RFC 7231 and RFC 5789. While these are the most commonly used ones, they only account for 9 out of the 39 (~23%) currently registered HTTP methods.

What is a Registered HTTP Method?

RFC 7231 states the following:

4 Request Methods 4.1 Overview

...

Additional methods, outside the scope of this specification, have been standardized for use in HTTP. All such methods ought to be registered within the "Hypertext Transfer Protocol (HTTP) Method Registry" maintained by IANA, as defined in Section 8.1.

...

8 IANA Considerations 8.1 Method Registry The "Hypertext Transfer Protocol (HTTP) Method Registry" defines the namespace for the request method token (Section 4). The method registry has been created and is now maintained at http://www.iana.org/assignments/http-methods.

Essentially a registered HTTP method is a method that has gone through the process of being added to IANA's HTTP Method Registry.

yoshuawuyts commented 3 years ago

Closes by #332.

Mart-Bogdan commented 11 months ago

There should have been open member Other(String) to support further methods, that can be added to IANA later, or ones that can be used privately by applications. Many HTTP servers just use String in place of method

Fishrock123 commented 10 months ago

I agree