无效的URI:URI字符串太长httpget

发布于 2025-02-07 14:10:04 字数 168 浏览 1 评论 0原文

下午好。我遇到了一个问题。我需要将一个微服务的get请求中的列表发送到另一个字符串,这些字符串是5到10个字符,但是我在此列表中有2000个项目。返回一个错误,即URL太长。当试图找到问题的答案时,我发现最大长度为2083个字符。由于这是一个获取请求,因此无法使用身体。如何在Get请求中将如此大的数据发送到另一个微服务?

Good afternoon. I ran into a problem. I need to send a List in a GET request from one microservice to another, these strings are from 5 to 10 characters, but I have 2000 items in this list. Returns an error that the URL is too long. When trying to find the answer to the problem, I found out that the maximum length is 2083 characters. Since this is a GET request and there is no way to use the body. How can I send such a large amount of data to another microservice in a GET request?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

橘亓 2025-02-14 14:10:04

谢谢您的建议。

真的需要成为一个请求吗?您可以使用帖子并将内容放入体内吗? - Wouter de Kort♦

我再次查看了这个问题,并认为获得请求并不是必需的。但是,我决定使用补丁而不是帖子,因为我不想将其与其他适当的帖子请求混淆,并且在其他任何地方都没有使用补丁。

Thank you Wouter de Kort ♦ for the suggestion.

Does it really need to be a GET request? Could you use a POST instead and put the content in the body? – Wouter de Kort ♦

I looked at the problem again and decided GET request wasn't really necessary. However, I decided to use PATCH instead of POST because I didn't want to confuse it with other proper POST requests and I didn't use PATCH anywhere else.

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