2015-04-06 20:22
浏览 58


I've written a simple GAE app that does a Get call to an external API but I'm getting a very strange error:

Get dial tcp: stat /etc/resolv.conf: operation not permitted

On my dev_appserver it works without any problems. So I'm wondering what could be the problem. I'm not using UrlFetch but my own package that uses http.NewRequest and http.DefaultClient.Do

Because of AppEngine restrictions I'm passing my own client to the NewClient call:

func createHttpClient() *http.Client {
    transport := http.Transport{}

    client := &http.Client{
        Transport: &transport,

    return client

client := createHttpClient()
c := mzalendo.NewClient(client)
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douxuan4556 2015-04-06 23:17

    On App Engine, you must use a transport created by the urlfetch package. The urlfetch Client function creates a client with an appropriate transport:

    func createHttpClient(r *http.Request) *http.Client {
        return urlfetch.Client(appengine.NewContext(r))
    解决 无用
    打赏 举报

相关推荐 更多相似问题