http.DefaultTransport和http.DefaultClient在AppEngine中不可用,但是lib使用它们

I'm using a library (gotwilio) that makes http requests to a server using a http.Client object:

client := &http.Client{}

However this fails on appengine with the following error message:

http.DefaultTransport and http.DefaultClient are not available in App Engine

This makes sense. However since the lib is using these directly there is no way for me to tell the library to use the urlfetch based transport that appengine provides.

Is there a way to make &http.Client{} always return a client that works with urlfetch.... In java this is also possible on appengine. (URLConnection just works)

Sadly no, OTOH you can just copy the library, change func (twilio *Twilio) post in github.com/sfreiberg/gotwilio/gotwilio.go and use your local copy until it's implemented properly.