Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(742)

Delta Between Two Patch Sets: src/pkg/http/response.go

Issue 4535056: code review 4535056: http: remove finalURL from Client.Get; move to Response (Closed)
Left Patch Set: diff -r c85198087f01 https://go.googlecode.com/hg Created 13 years, 10 months ago
Right Patch Set: diff -r f92afedc0ac0 https://go.googlecode.com/hg/ Created 13 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/http/request_test.go ('k') | src/pkg/http/response_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // HTTP Response reading and parsing. 5 // HTTP Response reading and parsing.
6 6
7 package http 7 package http
8 8
9 import ( 9 import (
10 "bufio" 10 "bufio"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // Close records whether the header directed that the connection be 59 // Close records whether the header directed that the connection be
60 // closed after reading Body. The value is advice for clients: neither 60 // closed after reading Body. The value is advice for clients: neither
61 // ReadResponse nor Response.Write ever closes a connection. 61 // ReadResponse nor Response.Write ever closes a connection.
62 Close bool 62 Close bool
63 63
64 // Trailer maps trailer keys to values, in the same 64 // Trailer maps trailer keys to values, in the same
65 // format as the header. 65 // format as the header.
66 Trailer Header 66 Trailer Header
67 67
68 » // The most recent Request that was sent to obtain this Response. 68 » // The Request that was sent to obtain this Response.
rsc 2011/05/13 02:45:13 s/most recent // (The earlier requests had other
69 // Request's Body is nil (having already been consumed). 69 // Request's Body is nil (having already been consumed).
70 // This is only populated for Client requests. 70 // This is only populated for Client requests.
71 Request *Request 71 Request *Request
72 } 72 }
73 73
74 // ReadResponse reads and returns an HTTP response from r. The 74 // ReadResponse reads and returns an HTTP response from r. The
75 // req parameter specifies the Request that corresponds to 75 // req parameter specifies the Request that corresponds to
76 // this Response. Clients must call resp.Body.Close when finished 76 // this Response. Clients must call resp.Body.Close when finished
77 // reading resp.Body. After that call, clients can inspect 77 // reading resp.Body. After that call, clients can inspect
78 // resp.Trailer to find key/value pairs included in the response 78 // resp.Trailer to find key/value pairs included in the response
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 // Write body and trailer 210 // Write body and trailer
211 err = tw.WriteBody(w) 211 err = tw.WriteBody(w)
212 if err != nil { 212 if err != nil {
213 return err 213 return err
214 } 214 }
215 215
216 // Success 216 // Success
217 return nil 217 return nil
218 } 218 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b