diff options
Diffstat (limited to 'src/pkg/http/client.go')
-rw-r--r-- | src/pkg/http/client.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/pkg/http/client.go b/src/pkg/http/client.go index fe61d2073..54487dac2 100644 --- a/src/pkg/http/client.go +++ b/src/pkg/http/client.go @@ -130,7 +130,6 @@ func Get(url string) (r *Response, finalURL string, err os.Error) { return } - // Post issues a POST to the specified URL. // // Caller should close r.Body when done reading it. @@ -154,6 +153,19 @@ func Post(url string, bodyType string, body io.Reader) (r *Response, err os.Erro return send(&req) } +// Head issues a HEAD to the specified URL. +func Head(url string) (r *Response, err os.Error) { + var req Request + req.Method = "HEAD" + if req.URL, err = ParseURL(url); err != nil { + return + } + if r, err = send(&req); err != nil { + return + } + return +} + type nopCloser struct { io.Reader } |