HTTP Post动态数据到和从Google App Engine

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

HTTP Post dynamic data to and from Google App Engine

问题

我想用Java编写一个应用程序,它将通过发送和接收动态数据与用Go编写的Google App Engine应用程序进行通信。这些数据不是人类可读的(即不是ASCII、Unicode或类似的),大小从几个字节到约1MB不等。

我想知道是否可以直接使用Post方法将这些数据发送到GAE并从GAE接收数据,或者最好将其编码为十六进制转储,并以文本形式传输(从而增加其大小几倍)。

英文:

I want to write an application in Java that will communicate with Google App Engine app written in Go by sending and receiving dynamic data. The data is not human readable (as in, not ASCII, Unicode or the like) and ranges from a couple bytes to about 1MB.

I am wondering if it is possible to send such data to and from GAE using Post method directly, or is it better to just encode it as a hex dump and transfer is at text (thusly increasing its size a couple times)?

答案1

得分: 3

是的,这是可能的,当然。就像HTTP响应一样,HTTP请求可以包含任何类型的有效负载(除非它是GET或其他不允许有主体的方法);只需适当设置内容类型并将数据发送到HTTP请求的主体中即可。

英文:

Yes, this is possible, of course. Just like an HTTP response, an HTTP request can contain a payload of any sort (unless it's a GET or other method that doesn't permit a body); just set the content-type appropriately and send the data in the body of the HTTP request.

答案2

得分: 2

如果人们可以将10MB的照片发布到Facebook上,那么我不明白为什么你不能用你的数据做同样的事情 HTTP Post动态数据到和从Google App Engine

英文:

If people can POST 10mb photos to Facebook, then I don't see why you can't do that with your data HTTP Post动态数据到和从Google App Engine

huangapple
  • 本文由 发表于 2011年11月2日 23:09:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/7982621.html
匿名

发表评论

匿名网友

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

确定