diff options
author | Andrew Gerrand <adg@golang.org> | 2010-06-08 01:28:40 +0200 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2010-06-08 01:28:40 +0200 |
commit | 30c4a8da1cf1eaf7833c60829a1f6ae35a96bee8 (patch) | |
tree | f9bb474eddebe933b6bd38ad1ec8d07fa359212c /src/pkg/http/client_test.go | |
parent | bbbbbf8523f3e81ca82873254abdbb75d3a22e4f (diff) | |
download | golang-30c4a8da1cf1eaf7833c60829a1f6ae35a96bee8.tar.gz |
http: add Head function for making HTTP HEAD requests
R=rsc
CC=golang-dev
http://codereview.appspot.com/1581041
Diffstat (limited to 'src/pkg/http/client_test.go')
-rw-r--r-- | src/pkg/http/client_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pkg/http/client_test.go b/src/pkg/http/client_test.go index 6787825d8..a916b12e2 100644 --- a/src/pkg/http/client_test.go +++ b/src/pkg/http/client_test.go @@ -28,3 +28,13 @@ func TestClient(t *testing.T) { t.Errorf("Incorrect page body (did not begin with User-agent): %q", s) } } + +func TestClientHead(t *testing.T) { + r, err := Head("http://www.google.com/robots.txt") + if err != nil { + t.Error(err) + } + if _, ok := r.Header["Last-Modified"]; !ok { + t.Error("Last-Modified header not found.") + } +} |