I have a JSP that looks like this:
<%
byte[] bytes = new byte[100];
int n = request.getInputStream().read(bytes);
System.out.println("Bytes len: " + n);
%>
and a python script that looks like this:
import httplib
h1 = httplib.HTTPConnection('localhost', 8080)
h1.putrequest('POST', '/SendM9/test.jsp')
h1.putheader('Content-Type','application/x-www-form-urlencoded')
h1.putheader('Content-Length','4')
h1.endheaders()
h1.send('koko')
h1.getresponse()
however, I get "Bytes len: -1".
Looking inside the variables I see that the parameters were parsed
(paremetersParsed = true).
Why does the servlet take my input stream and doesn't let me parse myself the
content?