>>> "Hindfelt, Mattias" <[EMAIL PROTECTED]> 18-May-00
10:15:56 AM >>>

>I have a problem with UrlConnections. I have to call
>a UrlConnections from a servlet and that has caused
>same wierd stuff. If I change them URL to for example
>yahoo.se then everything works (get method), but as soon
>as I use post method it doesn't work. (and yes the
>parameters are right) Anyone got any idea?

If you read the API doc for URLConnection and HttpURLConnection you
would see that you must set things like request method *before* you
call connect()

You don't:

      HttpURLConnection urlConn =
(HttpURLConnection)url.openConnection();
      urlConn.connect();
      urlConn.setDoOutput(true);
      urlConn.setRequestMethod("POST");



Please check API doc in future before asking here.



Nic Ferrier

___________________________________________________________________________
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