关于httpUrlConnection发送的问题
我有个问题,不知道大家碰到过没有
我客户端用的是httpurlconnection
主要代码如下:
httpconn.setDoOutput(true);
httpconn.setRequestMethod("POST");
httpconn.getOutputStream().write("hello".getBytes());
httpconn.getOutputStream().flush();
我客户端接收的时候:
BufferedReader socketReader = new BufferedReader(
new InputStreamReader(socket.getInputStream()));
具体用的是message = socketReader.readLine()函数
但是这个message只能显示http的头部信息:
POST / HTTP/1.1
User-Agent: Java/1.6.0_01
Host: 192.168.0.79:9080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Content-Length: 23
而看不到我想看得那个"hello"是怎么回事