Using the net/http i want a way to get the current request string and the method i.e. GET, POST, PUT etc.
Is this possible - i cant see it in the docs
You can use the following fields of the Request struct:
Method string
and
RequestURI string
I suggest you to look at the source code of the struct: Request struct source code
You can access it by clicking on the struct name in the go doc for the net/http package.
In the docs, start from http://golang.org/pkg/net/http and follow the "type Request" link to http://golang.org/pkg/net/http#Request. Everything you need is available as a field or method of Request.
For example, the HTTP method is Request.Method. The path and query parameters are in Request.URL.Path and Request.URL.Query(), respectively.
http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "%s %q", r.Method, html.EscapeString(r.URL.Path))
})
log.Fatal(http.ListenAndServe(":8080", nil))
Yes you can. all of that data is available inside of the HttpRequest. If you look in the Request.HttpMethod you will see the method (ie Get). You also have access to the header information if needed as well. depending on what you are doing, the FilePath, Path and several other properties will provide you with the data that has been posted.