So, I'm working on parsing a POST using GO. What I want is the body of the post, so I try the following (r
is of type *http.Request
in this context):
var body io.Reader
var d []byte
body = r.Body.Reader
body.Read( d)
However, this results in a compilation error:
Compile error: <file>:44:
r.Body.Reader undefined (type io.ReadCloser has no field or method Reader)
Odd. I could have sworn that it was defined in the docs... Ah! here it is.
Now, I'm fairly new to Go, but this smells a little odd -- what have I screwed up?