简体   繁体   English

带有 GET 方法的 Java 请求正文

[英]Java Request Body with GET method

is there an example of API call in java while sending request body with GET request method使用 GET 请求方法发送请求正文时,是否有 Java 中的 API 调用示例

I only found the example of POST request method.我只找到了POST请求方法的例子。

HTTP GET is not supposed to contain a request body, even though it can, it'll be antipattern by design. HTTP GET 不应该包含请求正文,即使它可以,它也将是设计上的反模式。 Check this Q/A for more insights-查看此问答以获取更多见解-

HTTP GET with request body 带有请求正文的 HTTP GET

Regarding making any kind of requests in Java, this might be a good resource- https://www.baeldung.com/java-http-request关于在 Java 中发出任何类型的请求,这可能是一个很好的资源 - https://www.baeldung.com/java-http-request

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

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