Sorry, i found the mistake: The stream was sent correctly, but it was
terminated with \n. In my PHP-Script I chopped the \n and everything worked
okay ;)

Christian

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Christian Kurze
> Sent: Monday, November 25, 2002 1:55 PM
> To: [EMAIL PROTECTED]
> Subject: [NET] sending data to web-server via POST
>
>
> Hello everybody,
>
> I use the class HttpURLConnection-Klasse as described in
> http://java.sun.com/features/2002/11/hilevel_network.html.
> I use example 5 to send POST-data to the server. On the server a
> PHP-script
> is running and simply returns the parameters sent to the server.
>
> My source-code (local client):
>
> ...
>       URL url = new
> URL("http://192.168.1.65/~ckurze/php/bodymed/vitalstoff/lesen.php";);
>       HttpURLConnection con = (HttpURLConnection) url.openConnection();
>       con.setUseCaches(false);
>       con.setDoInput(true);
>       con.setDoOutput(true);
>       con.setRequestMethod("POST");
>
>       PrintWriter out = new PrintWriter(con.getOutputStream());
>       out.println("action=receive");
>       out.close();
>
>       BufferedReader br = new BufferedReader(new
> InputStreamReader(con.getInputStream()));
>       String zeile;
> ...
>
> Unfortunatelly the server doesn't return anything. What have I done in a
> wrong way? I haven't found any information at google.
> Maybe you encountered the same problems.
>
> Thanks for your help,
> Christian.
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to