gpt4 book ai didi

java - 使用 Java 将 HTTP post 发送到 Web 服务器

转载 作者:可可西里 更新时间:2023-11-01 16:27:26 26 4
gpt4 key购买 nike

根据标题,我真的想发送自定义 HTTP post请求网络服务器,我在这方面经验不足。 Web 服务器使用 LDAP用于访问控制的服务器(不确定这是否重要)我当然知道用户名和密码。谁能充实一些代码来执行此操作或至少让我开始?

编辑其中一条评论,服务器正在运行一个 LAMP 堆栈,带有 PhP 5+ 和 Apache 2+

最佳答案

您可以使用 HttpClient来自 Apache 的模块。

Although the java.net package provides basic functionality for accessing resources via HTTP, it doesn't provide the full flexibility or functionality needed by many applications. HttpClient seeks to fill this void by providing an efficient, up-to-date, and feature-rich package implementing the client side of the most recent HTTP standards and recommendations.

Designed for extension while providing robust support for the base HTTP protocol, HttpClient may be of interest to anyone building HTTP-aware client applications such as web browsers, web service clients, or systems that leverage or extend the HTTP protocol for distributed communication.

关于java - 使用 Java 将 HTTP post 发送到 Web 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2305849/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com