简体   繁体   English

发送POST请求到服务器

[英]Sending a POST request to the server

I need to send a POST request using java. 我需要使用Java发送POST请求。 The server i am trying to access has a username and password i need to pass those parameters as well. 我尝试访问的服务器具有用户名和密码,我也需要传递这些参数。

1.) I have installed Tomcat in my machine and configured the developer environment. 1.)我已经在机器上安装了Tomcat并配置了开发人员环境。 I am using eclipse. 我正在使用日食。 There are different types of projects i could create using Eclipse, and i need to know what is the best project i should create to develop my application ? 我可以使用Eclipse创建各种类型的项目,我需要知道开发应用程序时应该创建的最佳项目是什么?

2.) Can someone show me some sample code or tutorial which would help me to develop my task ? 2.)有人可以向我展示一些示例代码或教程来帮助我完成任务吗?

My Eclipse version : Eclipse Java EE, Indigo service release 2 我的Eclipse版本:Eclipse Java EE,Indigo服务版本2

EDIT 编辑

Is it a JPA project, Enterprise Application Project, Dynamic Web Project, Dynamic Web Application, EJB project, Application Client project, Static Web Project. 它是JPA项目,企业应用程序项目,动态Web项目,动态Web应用程序,EJB项目,应用程序客户端项目,静态Web项目。

if you wanna create a website use "dynamic web project" 如果您想创建一个网站,请使用“动态Web项目”

for your issue, this might be useful: Java - sending HTTP parameters via POST method easily 对于您的问题,这可能有用: Java-通过POST方法轻松发送HTTP参数

Dynamic Web project should be the option you must select for performing this. 动态Web项目应该是执行此操作必须选择的选项。 In eclipse you can do this by following the steps as mentioned in the below link 在eclipse中,您可以按照以下链接中所述的步骤进行操作

http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.wst.webtools.doc.user%2Ftopics%2Ftwcreprj.html http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.wst.webtools.doc.user%2Ftopics%2Ftwcreprj.html

Please have a look at this link.. Hope will be helpful to you.. 请查看此链接。希望对您有所帮助。

Please read the link till point 20. Once you know how to write a web-service, we can arrange a training session with Shivang on how to integrate webservices with Appian. 请阅读链接,直到第20点。一旦您知道如何编写Web服务,我们就可以与Shivang安排一次培训课程,内容涉及如何将Webservices与Appian集成。

http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html

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

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