Open GoogleCodeExporter opened 9 years ago
tried this also,
var transport = &oauth.Transport{Config: config, Transport:urlfetch.Client(c)}
Original comment by gert.cuykens@gmail.com
on 4 Jan 2014 at 3:34
Maybe I don't understand the question... to use urlfetch from App Engine, you
can do something like this:
package example
import (
"net/http"
"appengine"
"appengine/urlfetch"
)
func handler(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
client := urlfetch.Client(c)
bucket := "my-bucket"
filepath := "myfile.txt"
url := fmt.Sprintf("https://www.googleapis.com/storage/v1beta2/b/%v/o/%v", url.QueryEscape(bucket), url.QueryEscape(filepath))
rsp, err := client.Get(url)
if err != nil {
c.Errorf("unable to client.Get(%v): %v", url, err)
}
//...
}
Original comment by gmle...@google.com
on 25 Apr 2014 at 3:09
Original issue reported on code.google.com by
gert.cuykens@gmail.com
on 4 Jan 2014 at 2:33