Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
3b901f45
Commit
3b901f45
authored
Nov 04, 2011
by
Brad Fitzpatrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: clarify Request docs
R=rsc CC=golang-dev
https://golang.org/cl/5342041
parent
28564d60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
request.go
src/pkg/net/http/request.go
+22
-8
No files found.
src/pkg/net/http/request.go
View file @
3b901f45
...
...
@@ -69,7 +69,8 @@ var reqWriteExcludeHeader = map[string]bool{
"Trailer"
:
true
,
}
// A Request represents a parsed HTTP request header.
// A Request represents an HTTP request received by a server
// or to be sent by a client.
type
Request
struct
{
Method
string
// GET, POST, PUT, etc.
URL
*
url
.
URL
...
...
@@ -106,14 +107,20 @@ type Request struct {
// ContentLength records the length of the associated content.
// The value -1 indicates that the length is unknown.
// Values >= 0 indicate that the given number of bytes may be read from Body.
// Values >= 0 indicate that the given number of bytes may
// be read from Body.
// For outgoing requests, a value of 0 means unknown if Body is not nil.
ContentLength
int64
// TransferEncoding lists the transfer encodings from outermost to innermost.
// An empty list denotes the "identity" encoding.
// TransferEncoding lists the transfer encodings from outermost to
// innermost. An empty list denotes the "identity" encoding.
// TransferEncoding can usually be ignored; chunked encoding is
// automatically added and removed as necessary when sending and
// receiving requests.
TransferEncoding
[]
string
// Whether to close the connection after replying to this request.
// Close indicates whether to close the connection after
// replying to this request.
Close
bool
// The host on which the URL is sought.
...
...
@@ -121,16 +128,21 @@ type Request struct {
// or the host name given in the URL itself.
Host
string
// The parsed form. Only available after ParseForm is called.
// Form contains the parsed form data, including both the URL
// field's query parameters and the POST or PUT form data.
// This field is only available after ParseForm is called.
// The HTTP client ignores Form and uses Body instead.
Form
url
.
Values
// The parsed multipart form, including file uploads.
// Only available after ParseMultipartForm is called.
// MultipartForm is the parsed multipart form, including file uploads.
// This field is only available after ParseMultipartForm is called.
// The HTTP client ignores MultipartForm and uses Body instead.
MultipartForm
*
multipart
.
Form
// Trailer maps trailer keys to values. Like for Header, if the
// response has multiple trailer lines with the same key, they will be
// concatenated, delimited by commas.
// Trailer support is only partially complete.
Trailer
Header
// RemoteAddr allows HTTP servers and other software to record
...
...
@@ -139,6 +151,7 @@ type Request struct {
// has no defined format. The HTTP server in this package
// sets RemoteAddr to an "IP:port" address before invoking a
// handler.
// This field is ignored by the HTTP client.
RemoteAddr
string
// TLS allows HTTP servers and other software to record
...
...
@@ -147,6 +160,7 @@ type Request struct {
// The HTTP server in this package sets the field for
// TLS-enabled connections before invoking a handler;
// otherwise it leaves the field nil.
// This field is ignored by the HTTP client.
TLS
*
tls
.
ConnectionState
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment