简体   繁体   English

无效的 URI:Uri 字符串太长 HttpGET

[英]Invalid URI: The Uri string is too long HttpGET

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.我需要从一个微服务向另一个微服务发送一个 GET 请求中的列表,这些字符串是 5 到 10 个字符,但我在这个列表中有 2000 个项目。 Returns an error that the URL is too long.返回 URL 太长的错误。 When trying to find the answer to the problem, I found out that the maximum length is 2083 characters.当试图找到问题的答案时,我发现最大长度为 2083 个字符。 Since this is a GET request and there is no way to use the body.由于这是一个 GET 请求,因此无法使用正文。 How can I send such a large amount of data to another microservice in a GET request?如何在 GET 请求中将如此大量的数据发送到另一个微服务?

Thank you Wouter de Kort ♦ for the suggestion.谢谢Wouter de Kort ♦ 的建议。

Does it really need to be a GET request?它真的需要一个 GET 请求吗? Could you use a POST instead and put the content in the body?您可以改用 POST 并将内容放在正文中吗? – Wouter de Kort ♦ – Wouter de Kort ♦

I looked at the problem again and decided GET request wasn't really necessary.我再次查看了这个问题,并认为 GET 请求并不是真正必要的。 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.但是,我决定使用 PATCH 而不是 POST,因为我不想将它与其他正确的 POST 请求混淆,并且我没有在其他任何地方使用 PATCH。

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

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