[code=java]Socket s=new Socket("192.168.0.102",8080);
PrintWriter out=new PrintWriter(s.getOutputStream(),true);
out.println("GET /myweb/web1.html HTTP/1.1 ");
out.println("Accept: */*");
out.println("Accept-Language: zh-CN");
out.println("Host: 192.168.0.102:10000");
out.println("Connection: Keep-Alive");
out.println();
out.println();
BufferedReader bf=new BufferedReader(new InputStreamReader(s.getInputStream()));
String line=null;
while((line=bf.readLine())!=null){
System.out.println(line);
}[/code]这个是我写的客户端代码,收到的确是:
HTTP/1.1 505 HTTP Version Not Supported
Server: Apache-Coyote/1.1
Date: Tue, 27 Sep 2011 11:57:01 GMT
Connection: close
这个问题有人见过么? |