Go urlfetch.Transport.RoundTrip, can call in GET, but not POST?

huangapple go评论89阅读模式
英文:

Go urlfetch.Transport.RoundTrip, can call in GET, but not POST?

问题

我在GAE Go中无法从urlfetch.Transport.RoundTrip获得任何响应。当我在浏览器中浏览调用该函数的页面时,调用会按预期执行。当从poclbm比特币矿工发出的POST请求中调用相同的函数时,我无法获得响应。

调用是由我创建的这个包的第77行发出的。

在Google App Engine中,是否可以通过HTTP GET请求从其他网页请求数据,但不能通过POST请求?还是还有其他原因导致这个问题?

英文:

I'm having a problem getting any response from urlfetch.Transport.RoundTrip in GAE Go. When I browse a page that makes the call in a browser, the call is executed as intended. When the same function is called from a POST request made by poclbm Bitcoin miner, I can't get a response.

The call is made by this package I made at line 77.

Is it possible, that in Google App Engine one can request data from other web pages under a HTTP GET, but not POST, or is there something else that can be causing this problem?

答案1

得分: 3

你可以使用http.Client.Post在App Engine上进行POST请求,只需确保使用urlfetch.Client函数创建http客户端。

英文:

You can do POST request from App Engine using http.Client.Post, just make sure you create the http client with urlfetch.Client function.

huangapple
  • 本文由 发表于 2012年3月6日 10:47:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/9577244.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定