Reputation: 954
I have a server that accepts post requests. The post is sent from the Apache libraries.
BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
"some code here handles status line"
While (input.ready) {
line = input.readLine()
if (line.length() == 0)
break;
System.out.println(line);
}
The problem is i never actually get the body? I only get the headers?
Thank you for any help
Upvotes: 0
Views: 139
Reputation: 7295
input.readLine();
"\r\n\r\n"
So the format could look like:
Header1\r\n
Header2\r\n
Header3\r\n\r\n
BODY
BODY
BODY...
Another option is to use com.sun.net.httpserver.HttpServer
Upvotes: 1