Skip to content

Commit

Permalink
make goauth compile with latest Go release.
Browse files Browse the repository at this point in the history
  • Loading branch information
akrennmair committed Oct 6, 2011
1 parent 35930f4 commit 55ae1ca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions http.go
Expand Up @@ -9,28 +9,29 @@ import (
"strings"
"bufio"
"crypto/tls"
"url"
)



// get Taken from the golang source modifed to allow headers to be passed and no redirection allowed
func get(url string, headers map[string]string) (r *http.Response, err os.Error) {
func get(url_ string, headers map[string]string) (r *http.Response, err os.Error) {

var req http.Request
if err != nil { return }
for k, v := range headers {
req.Header.Add(k, v)
}
// req.Header = headers
req.URL, err = http.ParseURL(url)
req.URL, err = url.Parse(url_)

r, err = send(&req)
if err != nil { return }
return
}

// post taken from Golang modified to allow Headers to be pased
func post(url string, headers map[string]string, body io.Reader) (r *http.Response, err os.Error) {
func post(url_ string, headers map[string]string, body io.Reader) (r *http.Response, err os.Error) {
var req http.Request
req.Method = "POST"
req.ProtoMajor = 1
Expand All @@ -42,7 +43,7 @@ func post(url string, headers map[string]string, body io.Reader) (r *http.Respon
}
req.TransferEncoding = []string{"chunked"}

req.URL, err = http.ParseURL(url)
req.URL, err = url.Parse(url_)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 55ae1ca

Please sign in to comment.