通过 RPC 发送大字符串会造成麻烦

发布于 2024-11-27 21:01:09 字数 525 浏览 5 评论 0原文

这是一个简短的问题。

我现在已经到了将图像发送到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对不⑦ 2024-12-04 21:01:09

附加此大小的标头将导致 RPC 出现问题,我建议您使用 HttpRequestBuilder。

Attaching a header of this size will cause issues to RPC, i suggest you use a HttpRequestBuilder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文