最常用的Http请求无非是get和post,get请求可以获取静态页面,也可以把参数放在URL字串后面,传递给servlet,post与get的不同之处在于post的参数不是放在URL字串里面,而是放在http请求的正文内。
在Java中可以使用HttpURLConnection发起这两种请求,了解此类,对于了解soap,和编写servlet的自动测试代码都有很大的帮助。
项目结构
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZUAAAFsCAIAAACLpLO9AAAgAElEQVR4nO2da3AU14Hv+0u+U5VU7frDrZDcLKFCXRtjzJLeLJds9gb77ofopooY7RqsEKcTJ1kjWCdINtgCCyzLJu7wsPEDMawNlrHkjC0YSwGCMAEEVmB4amAiJCEeejN6z0ganfuhZ7pPd5/umdE8T8//V6dcM6fP6e4RNT+fc6b73wIBAIAc5u1DF98+dNHlcgWiuFwuZZOQ3TMDAAB74C8AAK/AXwAAXsmmvy54T+48tG1NXd3OQ9sueE+m+3AAAIeRNX9d8J5cU1fnb3YF7zWtqasTD1+GwgAACZE5f12sLVULIaT6iI+MtLVc2nWqdevhK+8U7jr4REl1ao9I4ZEEyZO2vQMAskKG/OWtKdW/LVlTV1dz/dr7jXs+8Dxetedff71xb+GzOeMvjyQIEB4AuU56/bVr06u7Nr26a1PFRHfVRHfVWNubfRdf6zyx8fpna9fU1f3LiY7C/Yc3/uIHv322+MfP/nHtC9uSP6IF9v7yy6K62S+LgiBKkgh/AZDrpMBfx48fr6ioYG569YVtW/7QRAa/MJcL3pNPVp39wRtXVq+t+cnq93+y+uV0rn/F7y+rGgBAzpGsv44dOzZv3rw5c+ZYNVi3dgfprWMUQi54T27b+OHPnn5nwzrZSl5+WRQiqD7xSNEqUfarrSSPRxIiQ6doPfHLyhvaX4bu2lutG/wFAA8k5S9FXitWrLDx189+8Ta58wG7xIShEY+kt5PkIVHLRVtqTdQGqr8su2P8BQB3zNxfqrwKCwtt/EUI6Tm7t2P/8p6zewkhRU9XFT29RylPPb2n6Od7nlJe/3xP0dN7TF2VwZE2LqJHS9SYyaCbqKS06qi/4upO4C8AuGCG/q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DvRXUYmLBElEXvXtkQvxXY3FZa75SwuKy+TiElkQhFnzrcdfjEx6pr+I1dp8JBLfZv3ewl/sOHwtYR/r9wBoONNfgUDA6wu4GyPyitw8VOYqKCqbv7SgYEXx0oKiWfOLWb0zfumD5fzRAswfAYjiQH8VFLu87QFXvVe77bHMVVQsFxXLBUVlSwuK5i8umL+4IEf8RV1+b3VovyzSw0DoC4AITvTXL13zHyubrZSl0bK4bJZS5pfNml+sFFbvDPrLGJBvfWjqCW2QFwAqDvQXACBPgL8AALwCfwEAeAX+AgDwCvwFAOAVG3/9f1j8zSEss89WAAAAAElFTkSuQmCC" alt="" />
其中jsp1.jsp的代码
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head> <body>
jsp1<br>
</body>
</html>
下面的代码简单描述了如何使用HttpURLConnection发起这两种请求,以及传递参数的方法:
import java.io.*;
import java.net.*; public class HttpInvoker { public static final String GET_URL = "http://localhost:8080/servlet1/jsp1.jsp"; public static final String POST_URL = "http://localhost:8080/servlet1/jsp1.jsp"; public static void readContentFromGet() throws IOException {
// 拼凑get请求的URL字串,使用URLEncoder.encode对特殊和不可见字符进行编码
String getURL = GET_URL + "?username="
+ URLEncoder.encode("fat man", "utf-8");
URL getUrl = new URL(getURL);
// 根据拼凑的URL,打开连接,URL.openConnection函数会根据URL的类型,
// 返回不同的URLConnection子类的对象,这里URL是一个http,因此实际返回的是HttpURLConnection
HttpURLConnection connection = (HttpURLConnection) getUrl
.openConnection();
// 进行连接,但是实际上get request要在下一句的connection.getInputStream()函数中才会真正发到
// 服务器
connection.connect();
// 取得输入流,并使用Reader读取
BufferedReader reader = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
System.out.println("=============================");
System.out.println("Contents of get request");
System.out.println("=============================");
String lines;
while ((lines = reader.readLine()) != null) {
System.out.println(lines);
}
reader.close();
// 断开连接
connection.disconnect();
System.out.println("=============================");
System.out.println("Contents of get request ends");
System.out.println("=============================");
} public static void readContentFromPost() throws IOException {
// Post请求的url,与get不同的是不需要带参数
URL postUrl = new URL(POST_URL);
// 打开连接
HttpURLConnection connection = (HttpURLConnection) postUrl
.openConnection();
// Output to the connection. Default is
// false, set to true because post
// method must write something to the
// connection
// 设置是否向connection输出,因为这个是post请求,参数要放在
// http正文内,因此需要设为true
connection.setDoOutput(true);
// Read from the connection. Default is true.
connection.setDoInput(true);
// Set the post method. Default is GET
connection.setRequestMethod("POST");
// Post cannot use caches
// Post 请求不能使用缓存
connection.setUseCaches(false);
// This method takes effects to
// every instances of this class.
// URLConnection.setFollowRedirects是static函数,作用于所有的URLConnection对象。
// connection.setFollowRedirects(true); // This methods only
// takes effacts to this
// instance.
// URLConnection.setInstanceFollowRedirects是成员函数,仅作用于当前函数
connection.setInstanceFollowRedirects(true);
// Set the content type to urlencoded,
// because we will write
// some URL-encoded content to the
// connection. Settings above must be set before connect!
// 配置本次连接的Content-type,配置为application/x-www-form-urlencoded的
// 意思是正文是urlencoded编码过的form参数,下面我们可以看到我们对正文内容使用URLEncoder.encode
// 进行编码
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
// 连接,从postUrl.openConnection()至此的配置必须要在connect之前完成,
// 要注意的是connection.getOutputStream会隐含的进行connect。
connection.connect();
DataOutputStream out = new DataOutputStream(connection
.getOutputStream());
// The URL-encoded contend
// 正文,正文内容其实跟get的URL中'?'后的参数字符串一致
String content = "firstname=" + URLEncoder.encode("一个大肥人", "utf-8");
// DataOutputStream.writeBytes将字符串中的16位的unicode字符以8位的字符形式写道流里面
out.writeBytes(content); out.flush();
out.close(); // flush and close
BufferedReader reader = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
System.out.println("=============================");
System.out.println("Contents of post request");
System.out.println("=============================");
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
System.out.println("=============================");
System.out.println("Contents of post request ends");
System.out.println("=============================");
reader.close();
connection.disconnect();
} /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
readContentFromGet();
readContentFromPost();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} }
输出
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkYAAAJeCAIAAADeOl3NAAAgAElEQVR4nO3dO7LjutalbXVqOWpNWmxK2nR/44/YfroVbEZGVLnqRBqfUZ7KkEjiMiYA3iRq6n3iRJydXLyAIMhBQBJ5+e+///6N/gNwPv//8H/+v//1v/nfcf979xHGbi7/xZH29rbF//gf/+N//I//rfsfkcb/+B//43/8z8n/dKT9AwDg0xBpAAAniDQAgBMniLS/v38uP7//HrmJP7+O3sJL/P39c/n1592l+AB/fj3qaUvTekGzPJex0rDYW6puj0Z+lL+/fy6Xy4ZK2bBTRJqUhcfaNHke2y1Hd3shyiv68yssXqGq/vyK9+SoG4W/v3821tfbIu1ZReZyz79nDSKvymzK398/e9a23OKiSrcO//bDN500u5w6eTl3vzV8VJ3ekGoNf36VGknj7h8aaVEZltbVDvX72kg7Q19hYRn2jLTwT03F2O/Kv1PNzxfHv79/LpefX7+i1ZrXzvSad1Ck/f398/OzbUdX3zXvUcNWtcS3Dv/+/Arnyir96EiTW1y267pEOxy++Cgk9Vadv17OgyJNb+jnJ62lZ1wUI62heId2DYNdWZ4u7x0UI9La1u8o0rJTIVutcbK8JtIeJ9O28/WEkfbnV/m6nF4OD480tcWFu66KtMfhWzpGUjtqaTmPijS9od/J1v7+/vn5/btw7pws0paf6J8QafNYQjBy8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aI81e57Ze2usirXXQsVaaYqQVjtH6SJv/HdVmW6RFc43ZNHRBFMjNF+eUxZPltHNfLPvsOOX9p3hPzaa4INIWfZJJLw2f60yfpc1/EJ906HE1NYpX22xbpNnrPKCX1tihUrU0/zO70W8cdMxLo8cD1YWudIzqkWYNPFrr0Nf2ZMN6ncGilWFPNWep6pJy6mZj30lc+yFfsxizlS3OCDvV62vucdE9w0c7zzcexRDfNDV440zUJ9KDM6UTsj3SzHUeEWnBtpIthRN1Ld3vIk+aBx3TPmZ2QNLvHVgzWsfoMo/hqX0XGzIOsVVLMktLLUR+k6MyZ7Xqyk2x3MOT7SBardW8Sy1kXrx9FGNJ9gFndJLfpaFF8+hR40AmGn101X104YGFdKT934X+53/+Z+kiAADs6/8BCU6F7TTCnHIAAAAASUVORK5CYII=" alt="" />
把jsp1.jsp的源代码都读出来了
假如我们在servlet中
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; public class test1 extends HttpServlet { public test1() {
super();
} public static final String GET_URL = "http://localhost:8080/servlet1/jsp1.jsp"; public static final String POST_URL = "http://localhost:8080/servlet1/jsp1.jsp"; public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String getURL = GET_URL + "?username="+ URLEncoder.encode("fat man", "utf-8");
URL getUrl = new URL(getURL);
HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
connection.connect();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String lines;
StringBuffer sb=new StringBuffer();
while ((lines = reader.readLine()) != null) {
sb.append(lines);
}
reader.close();
// 断开连接
connection.disconnect();
//System.out.println(sb); response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.print(sb);
out.flush();
out.close(); } public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { } }
访问test1的servlet,它把jsp的资源给获取,然后response出去
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAU8AAABuCAIAAAAoKAaCAAAPfUlEQVR4nO2c+1cb14HH57/w/+DTbs5Zst3tpmm72+3jtEm2aePmpAlZl8RO6iS2MYbYsh1I/QDRVMaJycGAwgoBBtkUIQGGsEHGNtgYjBBIYJ6yeemBJPR+zIzC/iAkzUtCBhdw5vs53x/Q1Z07d2b0uffOICDOVWnOVbaeq1KfrWj5tOLvRV9eL7qs+uSLpjOfXz1dVi+RKSUXladkdRJZreRinUSmlMhqT/6t9qSs9qRMeVJWK5HVSS7WnSqrk5TVnSqrP11Wf/pSw6myhtNlDWcuXT19qeFMWf3psnrJxbpTZUpJmVIiU578m+LEZzUn/lpTUCovkMoLSuUfl8oLpNUFpdUfS+X50uoCaXV+LCWV+SWVx0uu5JdU5hdfOV5SdbykMr+kMr+kqkBaVSCtLpBWF0jlrPz1q4JSeSz5sUirj0urj5dUHS+pyiupzCupzCvmpCrxwzHhVHKSG8uFtCmuyi2uOlZcfawkETk71ceKq3OLq2L1j56/cvT8lSPnKlg5X3H0fEXsraPnrxw5X8GtEK92JF7niXOhkpncC5W5F6pinc8trmb0n93zeOcLL371/R+/8olMLty981vrW9rEG0+xl+RVqM4VPorEJVi/CkfjV2HzYZ9MXoevJPu5frbj51mwb8lPSBWztfXzLHTIqXYdC+EN0QiCiCGE3UchCCKGEDYvhSCIGELYvCSCIGIIYfWQGWZ5NTI577g7Otcz+LCzb1R7c1h7c/jGHUPP4MO7o3MTj1eWVyOZt4YgyDYno5X8kjM0YHrc1qsfmZy3OLy+IBkmaZL+lqS/DZO0L0hanb6Ryfm2Xv2A8dGSM7TjKxYEQfghrB4qTSxucujhYlf/2GPrapiKkvS3YSoaikQD8QQj0RAZjb0VoaKLdndn3+jQw0WLm0zfMoIg2xzC4iFTZdri7tVPm+YsQZIOU9FghA6kTTBCh6lomKRNc5Ze/fS0xb20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44Aag+gNvzP6AVQRwB1BhPucMLhi967b7hU1yUaMVjcm8yZQSDQjgixuONbymwPtQ9OfHWzvY4rkYxPm5ZcFmdwzR9f88ctzqBpySWdmKnjSi7cbG/rHzPbQ4XkBIFAO6KCPIxrfn1zWLvUIhr9pqXvcl33+Zq28zVtl251fdPS951oRKFdml/f3PfxgEA/NCEL7jgIBGKvwMMgELuFLLjiIBCIvULmXXEQCMReIdwhDQgEYq+Q/f5FMQAAngrwMACwG/AwALAb8DAAsBvwMACwG/AwALAb8DAAsBvwMACwG/AwALAb8DAAsBvwMACwG/AwALAb8DAAsBsmD/dVFSPIgT6jcxt5nca+AwhSXNW33cIAACiIXVmHZ/nV+P+3CR4GgN1m9/bSzuLnDoCHAWC3AQ8DALth8vAsvxpBDs2m3x1CEAQ50GdUFRVVZ1qq+ari5w4gCEKIxAEPA8BekNfD6XvalDOriw5V82dxZx4qqsYfWSEpVztxPx94rpjw+As8DAB7QaHrcHXRIbJFU0+eq/mzhGDiQ2zwMADsBYV6OGfhpXrYaew7AB4GgD2n8PvhVFv6rthJtw4Tg8HDALAXFL6X/nV6jZ09RPDwodTzrVzHzh6Cnw8DwO7zBB5+LvX8OeVM3MNFRUV4Y9rMmY7pnTf5LhoAgJ3lSffSWSh7aQAA9oUtPExcXSmAhwHgWYDGw5mdMMM2mPCYGmwMAPsJ/NtDAGA34GEAYDfgYQBgN+BhAGA34GEAYDfgYQBgN+BhAGA34GEAYDfgYQBgN+BhAGA34GEAYDfgYQBgN+BhAGA34GEAYDfgYQBgN+BhAGA34GEAYDfgYQBgN+BhAGA34GEAYDfgYQBgN+BhAGA34GEAYDfgYQBgN+BhAGA34GEAYDfgYQBgN+BhAGA34GEAYDf/D27daYdQGRnpAAAAAElFTkSuQmCC" alt="" />
上面的readContentFromGet()函数产生了一个get请求,传给servlet一个username参数,值为"fat man"。
readContentFromPost()函数产生了一个post请求,传给servlet一个firstname参数,值为"一个大肥人"。
HttpURLConnection.connect函数,实际上只是建立了一个与服务器的tcp连接,并没有实际发送http请求。无论是post还是get,http请求实际上直到HttpURLConnection.getInputStream()这个函数里面才正式发送出去。
在readContentFromPost()
中,顺序是重中之重,对connection对象的一切配置(那一堆set函数)都必须要在connect()函数执行之前完成。而对
outputStream的写操作,又必须要在inputStream的读操作之前。这些顺序实际上是由http请求的格式决定的。
http
请求实际上由两部分组成,一个是http头,所有关于此次http请求的配置都在http头里面定义,一个是正文content,在connect()函
数里面,会根据HttpURLConnection对象的配置值生成http头,因此在调用connect函数之前,就必须把所有的配置准备好。
紧接着http头的是http请求的正文,正文的内容通过outputStream写入,实际上outputStream不是一个网络流,充其量是个字符串流,往里面写入的东西不会立即发送到网络,而是在流关闭后,根据输入的内容生成http正文。
至
此,http请求的东西已经准备就绪。在getInputStream()函数调用的时候,就会把准备好的http请求正式发送到服务器了,然后返回一个
输入流,用于读取服务器对于此次http请求的返回信息。由于http请求在getInputStream的时候已经发送出去了(包括http头和正
文),因此在getInputStream()函数之后对connection对象进行设置(对http头的信息进行修改)或者写入
outputStream(对正文进行修改)都是没有意义的了,执行这些操作会导致异常的发生。