简体   繁体   English

如何将JSON从Android发送到Servlet

[英]How to send JSON from android to Servlet

I get the JSON of User Info from Facebook on Android. 我从Android上的Facebook获取用户信息的JSON。 And then send the JSON to my servlet (the platform is GAE). 然后将JSON发送到我的servlet(平台是GAE)。

My question is how to send it properly. 我的问题是如何正确发送。 Since the JSON could be very long. 由于JSON可能很长。 So far, I have tried this way . 到目前为止,我已经尝试过这种方式 But I cannot receive the entire JSON. 但是我无法收到整个JSON。 It always throws 它总是抛出

Unterminated string at character 117 of {"music":{"data":[{"created_time":"2011-05-23T16:47:21 0000","id":"176345129540","category":"Musician/band","name":" {“ music”:{“ data”:[{“ created_time”:“ 2011-05-23T16:47:21 0000”,“ id”:“ 176345129540”,“ category”:“ Musician /乐队”,“名称”:“

And I print the JSON, I find that the JSON is just as above which is been cut. 然后,我打印了JSON,发现JSON与上面被剪切的一样。
Thanks in advance. 提前致谢。

Http GET可以发送的数据大小可能有限制,请看一下这个问题,然后重写使用Http POST的请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM