当前位置: 技术问答>java相关
编个客户端,如何向类似"http://www.csdn.net/expert/index.asp?room=参数"发送参数?
来源: 互联网 发布时间:2015-02-21
本文导语: 比如我要将 参数:"100" 发送至 http://www.csdn.net/expert/index.asp?room=参数, 服务器方得到的就是: http://www.csdn.net/expert/index.asp?room=100 用什么方法? | int room=100; action="http://www.csdn.net/expert/index.asp?r...
比如我要将 参数:"100" 发送至
http://www.csdn.net/expert/index.asp?room=参数,
服务器方得到的就是:
http://www.csdn.net/expert/index.asp?room=100
用什么方法?
http://www.csdn.net/expert/index.asp?room=参数,
服务器方得到的就是:
http://www.csdn.net/expert/index.asp?room=100
用什么方法?
|
int room=100;
action="http://www.csdn.net/expert/index.asp?room="
or action="http://www.csdn.net/expert/index.asp?room=100"
or
response.sendRedirect("http://www.csdn.net/expert/index.asp?room=100");
response.sendRedirect("http://www.csdn.net/expert/index.asp?room="+room);
action="http://www.csdn.net/expert/index.asp?room="
or action="http://www.csdn.net/expert/index.asp?room=100"
or
response.sendRedirect("http://www.csdn.net/expert/index.asp?room=100");
response.sendRedirect("http://www.csdn.net/expert/index.asp?room="+room);
|
URL url = new URL("http://www.csdn.net/expert/index.asp?room=100"););
httpConnection = (HttpURLConnection)url.openConnection ();
httpConnection = (HttpURLConnection)url.openConnection ();