通过 RPC 发送大字符串会造成麻烦
这是一个简短的问题。
我现在已经到了将图像发送到 blobstore 的阶段,但 RPC 部分导致了问题。
通过 RPC 发送 Base64 编码的图像数据(如数据:image/png;base64,iVBORw0KGgoAAAANS 等)会在服务器端产生一个“header”被添加到字符串中。
所以字符串变成
7|0|6|http://127.0.0.1:8888/justatest/|EEBD10CD0*更多数字*com.rohan.justatest.client.linkservice.getlink.java.lang.string/2010016611|data: image/png;base64rest 我的图像和最后 1|2|3|4|5|6
所以我的问题是,为什么会发生这种情况?我不介意技术故事。
或者... RPC 不是为更大的文件构建的吗?我应该使用 RequestBuiler 来代替吗?
我还尝试了一个包含一个字符串的包装类,它给出了相同的结果。
预先感谢,非常感谢您的帮助!
So this is a quick question.
I have now reached the stage of sending my image to the blobstore but the RPC part is causing issues.
Sending the base64 encoded image data(like this data:image/png;base64,iVBORw0KGgoAAAANS etc) over RPC results in server-side a ?header? being added to the string.
So the string becomes
7|0|6|http://127.0.0.1:8888/justatest/|EEBD10CD0*more numbers*com.rohan.justatest.client.linkservice.getlink.java.lang.string/2010016611|data:image/png;base64rest of my image and at the end 1|2|3|4|5|6
So my question to you, why is this happening? i don't mind a technical story.
Or... is RPC not built for bigger files and should i use the RequestBuiler instead?
Also i tried a wrapper class with one string in it and it gave the same result.
Thanks in advance, help is much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
附加此大小的标头将导致 RPC 出现问题,我建议您使用 HttpRequestBuilder。
Attaching a header of this size will cause issues to RPC, i suggest you use a HttpRequestBuilder.