You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by "GU,JAMES (HP-Corvallis,ex1)" <ja...@hp.com> on 2001/02/01 04:38:36 UTC

how to compose and handle an http put request

I have a case where I want to use http "put" rather than ftp to upload a file to
the server, so I don't have to expose the actual directory structure. I want to
use HttpURLConnection to send the request, but I couldn't find any examples
about how to compose a put request using the URLConnection object and how to
handle the put request in my servlet. 

In my servlet doPut(), getReader() from httpservletrequest can only print out
the querystring, not the content I have sent to the server using URLConnection
class's getOutputStream(). 

Any ideas or pointers to any web pages? 

Thank a lot!!!