mirror of
https://github.com/golang/go
synced 2024-11-22 07:14:40 -07:00
http: clarify docs on Request HTTP version
Fixes #910 R=adg, rsc1 CC=golang-dev https://golang.org/cl/4439062
This commit is contained in:
parent
750b6c63f9
commit
8d6a12f570
@ -31,6 +31,8 @@ func drainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err os.Error) {
|
|||||||
// DumpRequest is semantically a no-op, but in order to
|
// DumpRequest is semantically a no-op, but in order to
|
||||||
// dump the body, it reads the body data into memory and
|
// dump the body, it reads the body data into memory and
|
||||||
// changes req.Body to refer to the in-memory copy.
|
// changes req.Body to refer to the in-memory copy.
|
||||||
|
// The documentation for Request.Write details which fields
|
||||||
|
// of req are used.
|
||||||
func DumpRequest(req *Request, body bool) (dump []byte, err os.Error) {
|
func DumpRequest(req *Request, body bool) (dump []byte, err os.Error) {
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
save := req.Body
|
save := req.Body
|
||||||
|
@ -67,6 +67,9 @@ type Request struct {
|
|||||||
Method string // GET, POST, PUT, etc.
|
Method string // GET, POST, PUT, etc.
|
||||||
RawURL string // The raw URL given in the request.
|
RawURL string // The raw URL given in the request.
|
||||||
URL *URL // Parsed URL.
|
URL *URL // Parsed URL.
|
||||||
|
|
||||||
|
// The protocol version for incoming requests.
|
||||||
|
// Outgoing requests always use HTTP/1.1.
|
||||||
Proto string // "HTTP/1.0"
|
Proto string // "HTTP/1.0"
|
||||||
ProtoMajor int // 1
|
ProtoMajor int // 1
|
||||||
ProtoMinor int // 0
|
ProtoMinor int // 0
|
||||||
|
Loading…
Reference in New Issue
Block a user