]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: add method constants
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 12 Nov 2015 15:33:23 +0000 (15:33 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 13 Nov 2015 10:12:46 +0000 (10:12 +0000)
Fixes #12078

Change-Id: Ia8738123b07ca29be4a0cf400ee143729c8b5b3c
Reviewed-on: https://go-review.googlesource.com/16860
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/http/method.go [new file with mode: 0644]

diff --git a/src/net/http/method.go b/src/net/http/method.go
new file mode 100644 (file)
index 0000000..b74f960
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package http
+
+// Common HTTP methods.
+//
+// Unless otherwise noted, these are defined in RFC 7231 section 4.3.
+const (
+       MethodGet     = "GET"
+       MethodHead    = "HEAD"
+       MethodPost    = "POST"
+       MethodPut     = "PUT"
+       MethodPatch   = "PATCH" // RFC 5741
+       MethodDelete  = "DELETE"
+       MethodConnect = "CONNECT"
+       MethodOptions = "OPTIONS"
+       MethodTrace   = "TRACE"
+)