I am making a HTTP POST query to a server and I am creating the post body manually. I think I am making some mistake with the content-length header because on the server side when I get the http response at the beginning I see the headers with http response 200 and then when in my php script I print
Tag: post
Sending Java POST request without calling getInputStream()
I would like to send a POST request in Java. At the moment, I do it like this: I do not understand why I have to call con.getInputStream() in order to actually send the request. If I do not call it, the request is not sent. Is there a problem using PrintStream? It should not matter if I take a