summaryrefslogtreecommitdiff
path: root/src/pkg/http/request.go
AgeCommit message (Collapse)AuthorFilesLines
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-31/+82
2010-07-01strings and bytes.Split: make count of 0 mean 0, not infinite.Rob Pike1-1/+1
Use a count of -1 for infinity. Ditto for Replace. R=rsc CC=golang-dev http://codereview.appspot.com/1704044 Committer: Rob Pike <r@golang.org>
2010-06-16http: reply to Expect 100-continue requests automaticallyBrad Fitzpatrick1-0/+5
This CL replaces my earlier http://codereview.appspot.com/1640044/show in which Continue handling was explicit. Instead, this CL makes it automatic. Reading from Body() is an implicit acknowledgement that the request headers were fine and the body is wanted. In that case, the 100 Continue response is written automatically when the request continues the "Expect: 100-continue" header. R=rsc, adg CC=golang-dev http://codereview.appspot.com/1610042 Committer: Russ Cox <rsc@golang.org>
2010-06-06http: fix erroneous commentAndrew Gerrand1-4/+4
R=r CC=golang-dev http://codereview.appspot.com/1539042
2010-05-11http: prevent crash if remote server is not responding with "HTTP/"Robert Griesemer1-1/+1
Fixes issue 775. R=rsc CC=golang-dev http://codereview.appspot.com/1180042
2010-03-30simplify various code using new map index ruleRuss Cox1-33/+20
R=r CC=golang-dev http://codereview.appspot.com/833044
2010-03-16http: add ParseQueryPetar Maymounkov1-3/+7
R=rsc CC=golang-dev http://codereview.appspot.com/238041 Committer: Russ Cox <rsc@golang.org>
2010-03-02gofmt: experiment: align values in map composites where possibleRobert Griesemer1-5/+5
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev http://codereview.appspot.com/223076
2010-02-25strings: delete Runes, BytesRuss Cox1-1/+1
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev http://codereview.appspot.com/224062
2010-02-22http: use RawURL in Request.WritePetar Maymounkov1-4/+7
R=rsc CC=golang-dev http://codereview.appspot.com/217066 Committer: Russ Cox <rsc@golang.org>
2010-02-21http request URI should never be emptyMichael Hoisie1-1/+1
R=rsc, adg CC=golang-dev http://codereview.appspot.com/217071 Committer: Andrew Gerrand <adg@golang.org>
2010-02-19http: unified body transfer (read & write) logic in http.Request/Response.Petar Maymounkov1-53/+41
Compliance issue addressed here: POST requests carrying form data are required to use "identity" transfer encoding by common nginx and apache server configurations, e.g. wordpress.com (and many others). So, Request needed to be able to send non-chunked encodings. Thus, Request is extended to support identity and chunked encodings, like Response. Since the Read() and Write() logic are shared by both (and are quite long), it is exported in a separate file transfer.go. R=rsc CC=golang-dev http://codereview.appspot.com/217048 Committer: Russ Cox <rsc@golang.org>
2010-02-09http: protect io.WriteString in Request/Response.Write with error checking,Petar Maymounkov1-1/+4
since they were causing a silent program exit (too many EPIPE's). R=rsc CC=golang-dev http://codereview.appspot.com/204062 Committer: Russ Cox <rsc@golang.org>
2010-02-05http: sort header keys when writing Response or Request to wirePetar Maymounkov1-8/+3
R=rsc CC=golang-dev http://codereview.appspot.com/203050 Committer: Russ Cox <rsc@golang.org>
2010-02-04http: use ChunkWriter in Request.WritePetar Maymounkov1-27/+15
R=rsc CC=golang-dev http://codereview.appspot.com/196079 Committer: Russ Cox <rsc@golang.org>
2010-01-29http: increase header line limit, let req.Host override req.URL.HostPetar Maymounkov1-4/+11
Fixes issue 566. R=rsc CC=golang-dev http://codereview.appspot.com/194074 Committer: Russ Cox <rsc@golang.org>
2010-01-28Cosmetic bug or compliance fixes in http.Response.Petar Maymounkov1-1/+1
(1) http.Response must close resp.Body after writing. (2) Case when resp.Body != nil and resp.ContentLength = 0 should not be treated as an error in Response.Write, because this is what ReadResponse often returns. (3) Changed body.th to body.hdr for readability. R=rsc CC=golang-dev http://codereview.appspot.com/194084 Committer: Russ Cox <rsc@golang.org>
2010-01-25http: make Request.Body an io.ReadCloser, matching Response.Body.Petar Maymounkov1-10/+7
R=rsc, rsc1 CC=golang-dev http://codereview.appspot.com/194046 Committer: Russ Cox <rsc@golang.org>
2010-01-18Significant extension to http.Response, which now adheres to thePetar Maymounkov1-3/+6
usage pattern of http.Request and paves the way to persistent connection handling. R=rsc CC=golang-dev http://codereview.appspot.com/185043 Committer: Russ Cox <rsc@golang.org>
2010-01-07http: most of a URL shouldn't use URL-escapingRuss Cox1-1/+1
Fixes issue 502. R=r, hoisie CC=golang-dev http://codereview.appspot.com/181179
2010-01-06http: avoid header duplication - take struct fields out of Header mapRuss Cox1-2/+12
R=r CC=golang-dev, petar-m http://codereview.appspot.com/183132
2009-12-151) Change default gofmt default settings forRobert Griesemer1-123/+123
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 3rd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180048
2009-12-02move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.Rob Pike1-1/+2
this breaks the dependency of package io on package bytes. R=rsc CC=golang-dev http://codereview.appspot.com/163085
2009-11-24Change to container/vector interface:Robert Griesemer1-1/+1
- removed New(len int) in favor of new(Vector).Resize(len, cap) - removed Init(len int) in favor of Resize(len, cap) - runs all.bash Fixes issue 294. R=rsc, r, r1 http://codereview.appspot.com/157143
2009-11-20gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkgRuss Cox1-1/+1
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
2009-11-17http: do not crash accessing r.Form if ParseForm failsRuss Cox1-6/+4
Fixes issue 233. R=dsymonds1 http://codereview.appspot.com/154179
2009-11-10allow user agent to mention Go.Russ Cox1-2/+1
R=r http://go/go-review/1024046
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer1-6/+6
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-68/+68
R=rsc, r http://go/go-review/1025029
2009-11-08a nagging inconsistency: capitalization ofRuss Cox1-11/+11
HTML vs Html, URL vs Url, HTTP vs Http, current source is 6:1 in favor of the former, so change instances of the latter. R=r CC=go-dev http://go/go-review/1024026
2009-11-06- fine-tuning of one-line func heuristic (nodes.go)Robert Griesemer1-3/+1
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
2009-10-23publish Request.Write (rename from Request.write)Rob Pike1-2/+2
R=rsc CC=go-dev http://go/go-review/1015003
2009-10-08more lgtm files from gofmtRuss Cox1-89/+89
R=gri OCL=35485 CL=35488
2009-10-03Fixing HTTP POST handling to work with Chrome and Safari.Bill Neubauer1-1/+1
request.go does not handle Content-Type correctly for the definition of Media Types. http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 R=rsc APPROVED=rsc DELTA=44 (42 added, 0 deleted, 2 changed) OCL=35274 CL=35306
2009-09-15more "declared and not used".Russ Cox1-1/+1
the last round omitted := range and only checked 1 out of N vars in a multi-var := R=r OCL=34624 CL=34638
2009-09-14fix "declared and not used" errors in non-test code.Russ Cox1-2/+1
R=r DELTA=112 (6 added, 57 deleted, 49 changed) OCL=34610 CL=34610
2009-08-27remove Line in bufio.ReadLine(Bytes|Slice|String)Russ Cox1-1/+1
also drop bool arg from ReadString R=r DELTA=45 (13 added, 1 deleted, 31 changed) OCL=33923 CL=33960
2009-08-20naming cleanup.Russ Cox1-1/+1
gzip.GzipInflater -> gzip.Inflater gzip.NewGzipInflater -> gzip.NewInflater zlib.NewZlibInflater -> zlib.NewInflater io.ByteReader deleted in favor of bytes.Buffer io.NewByteReader -> bytes.NewBuffer R=r DELTA=52 (3 added, 0 deleted, 49 changed) OCL=33589 CL=33592
2009-08-12convert non-low-level non-google pkg codeRuss Cox1-1/+0
to whole-package compilation. R=r OCL=33070 CL=33101
2009-06-29bug163 bug164 bug166Russ Cox1-1/+1
R=ken OCL=30889 CL=30889
2009-06-29io.StringBytes -> strings.BytesRuss Cox1-1/+1
io.ByteBuffer -> bytes.Buffer left io.ByteBuffer stub around for now, for protocol compiler. R=r OCL=30861 CL=30872
2009-06-25http Request parsing, plus a convenient accessor.David Symonds1-24/+54
R=rsc APPROVED=rsc DELTA=95 (40 added, 14 deleted, 41 changed) OCL=30727 CL=30784
2009-06-25Change os.Error convention:Russ Cox1-62/+73
echo back context of call in error if likely to be useful. For example, if os.Open("/etc/passwd", os.O_RDONLY) fails with syscall.EPERM, it returns as the os.Error &PathError{ Op: "open", Path: "/etc/passwd" Error: os.EPERM } which formats as open /etc/passwd: permission denied Not converted: datafmt go/... google/... regexp tabwriter template R=r DELTA=1153 (561 added, 156 deleted, 436 changed) OCL=30738 CL=30781
2009-06-24Change strings.Split, bytes.Split to take a maximum substring count argument.David Symonds1-3/+3
R=rsc APPROVED=r DELTA=131 (39 added, 10 deleted, 82 changed) OCL=30669 CL=30723
2009-06-23Fix http client handling of status messages with spaces (e.g. "HTTP/1.1 400 BadDavid Symonds1-9/+113
Request". Use chunked Transfer-Encoding for all POSTs. Implement chunked reading. Change http.Request.write to be HTTP/1.1 only. R=rsc APPROVED=rsc DELTA=178 (123 added, 26 deleted, 29 changed) OCL=30563 CL=30673
2009-06-22Don't prefix Url.Path with a slash in Request.write,David Symonds1-1/+5
because Url.Path already starts with one. Avoid crashing in Request.ParseForm if there is no body. R=rsc APPROVED=rsc DELTA=5 (4 added, 0 deleted, 1 changed) OCL=30552 CL=30607
2009-06-22introduce os.EOF and io.ErrUnexpectedEOF.Russ Cox1-2/+2
remove io.ErrEOF. rename io.FullRead to io.ReadFull, to match ReadAtLeast and ReadAll. remove io.FullReader, because it is now unused. R=r DELTA=295 (88 added, 105 deleted, 102 changed) OCL=30544 CL=30588
2009-06-19Add form body parsing to http.Request.David Symonds1-0/+48
better error handling throughout. R=r,rsc APPROVED=r DELTA=254 (201 added, 3 deleted, 50 changed) OCL=30515 CL=30545
2009-06-09Basic HTTP client.Steve Newman1-5/+53
R=rsc APPROVED=rsc DELTA=392 (386 added, 2 deleted, 4 changed) OCL=29963 CL=30107
2009-06-09mv src/lib to src/pkgRob Pike1-0/+413
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102