diff --git a/method/bytes.go b/method/bytes.go new file mode 100644 index 0000000..6d85d72 --- /dev/null +++ b/method/bytes.go @@ -0,0 +1,43 @@ +package method + +import ( + "sourcecode.social/reiver/go-rfc2616/token" +) + +// Bytes returns the 'Method', as defiend by IETF RFC-2616. +// +// Method = "OPTIONS" +// | "GET" +// | "HEAD" +// | "POST" +// | "PUT" +// | "DELETE" +// | "TRACE" +// | "CONNECT" +// | extension-method +// +// extension-method = token +// +// Which, in practice, can be simplified to: +// +// Method = token +// +// And 'token' is defined as: +// +// token = 1* +// +// CHAR = +// +// CTL = +// +// separators = "(" | ")" | "<" | ">" | "@" +// | "," | ";" | ":" | "\" | <"> +// | "/" | "[" | "]" | "?" | "=" +// | "{" | "}" | SP | HT +// +// SP = +// +// HT = +func Bytes(p []byte) ([]byte, []byte, bool) { + return token.Bytes(p) +} diff --git a/token/bytes.go b/token/bytes.go index 07af6aa..136e538 100644 --- a/token/bytes.go +++ b/token/bytes.go @@ -6,25 +6,7 @@ import ( "sourcecode.social/reiver/go-rfc2616/separator" ) -// Bytes returns the 'Method', as defiend by IETF RFC-2616. -// -// Method = "OPTIONS" -// | "GET" -// | "HEAD" -// | "POST" -// | "PUT" -// | "DELETE" -// | "TRACE" -// | "CONNECT" -// | extension-method -// -// extension-method = token -// -// Which, in practice, can be simplified to: -// -// Method = token -// -// And 'token' is defined as: +// Bytes returns the 'token', as defiend by IETF RFC-2616. // // token = 1* //