Skip to content

Commit 0b314e1

Browse files
committed
net/http: add method constants
Fixes #12078 Change-Id: Ia8738123b07ca29be4a0cf400ee143729c8b5b3c Reviewed-on: https://go-review.googlesource.com/16860 Reviewed-by: Andrew Gerrand <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent d75391a commit 0b314e1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/net/http/method.go

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2015 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package http
6+
7+
// Common HTTP methods.
8+
//
9+
// Unless otherwise noted, these are defined in RFC 7231 section 4.3.
10+
const (
11+
MethodGet = "GET"
12+
MethodHead = "HEAD"
13+
MethodPost = "POST"
14+
MethodPut = "PUT"
15+
MethodPatch = "PATCH" // RFC 5741
16+
MethodDelete = "DELETE"
17+
MethodConnect = "CONNECT"
18+
MethodOptions = "OPTIONS"
19+
MethodTrace = "TRACE"
20+
)

0 commit comments

Comments
 (0)