相关疑难解决方法(0)

在Java中发送HTTP POST请求

我们假设这个URL ...

http://www.example.com/page.php?id=10            
Run Code Online (Sandbox Code Playgroud)

(这里需要在POST请求中发送id)

我想发送id = 10到服务器page.php,它在POST方法中接受它.

我怎样才能从Java中做到这一点?

我试过这个:

URL aaa = new URL("http://www.example.com/page.php");
URLConnection ccc = aaa.openConnection();
Run Code Online (Sandbox Code Playgroud)

但我仍然无法弄清楚如何通过POST发送它

java post http

280
推荐指数
10
解决办法
67万
查看次数

标签 统计

http ×1

java ×1

post ×1