Go: proposal: net/http: add MethodSearch constant for HTTP SEARCH method

Created on 23 Jan 2019  ·  3Comments  ·  Source: golang/go

What version of Go are you using (go version)?

$ go version
go version go1.11.4 darwin/amd64

What operating system and processor architecture are you using (go env)?

MacOS/amd64

go env Output

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/arthur/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/arthur/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.4/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0m/qqy9wr_n4l5_2zhm0fhnp9jw0000gp/T/go-build084923408=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Added a MethodSearch = "SEARCH" to http/net/method.go, to let developers conveniently use public API, in this particular case constant for http requests in web-apps.

References to RFCs and examples:
https://tools.ietf.org/id/draft-snell-search-method-00.html#search
https://tools.ietf.org/id/draft-snell-search-method-00.html#rfc.section.4.2

Proposal Proposal-Hold

All 3 comments

My usual question: what about SPACEJUMP?

Where do we draw the line?

Let's leave net/http alone until we redo the client API wholesale.
See https://github.com/golang/go/issues/22841#issuecomment-347334624 for the same sentiment for Put/Patch methods.

@bradfitz from my experience the line always between proved theories with practical needs and other crazy things. So, here we have method SEARCH that, practically, can be used only for requests that query search results e.g.: full-text search and isolate those from overloaded GET, logically separating them.

@rsc Go-team opened code for open-source community, now it seems like: "let`s leave code alone" - do not touch API, until we redo and then put those methods our-selfs into the code. I saw already, that guys from formal go-team just rework code a little and put it as their own, although the pull requests left non-merged and then closed, I would never do things like that to contributors in my projects, because it is straight bullying and misusage of power.

Was this page helpful?
0 / 5 - 0 ratings