Package httprequestpath provides tools for getting the path from an http.Request
, for the Go programming language.
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-httprequestpath
import "github.com/reiver/go-httprequestpath"
// ...
path, err := httprequestpath.HTTPRequestPath(request)
if nil != err {
var code int = http.StatusInternalServerError
var text string = http.StatusText(code)
http.Error(responseWriter, text, code)
return
}
To import package httprequestpath use import
code like the follownig:
import "github.com/reiver/go-httprequestpath"
To install package httprequestpath do the following:
GOPROXY=direct go get https://github.com/reiver/go-httprequestpath
Package httprequestpath was written by Charles Iliya Krempeaux