tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject [OT] Re: PUT or POST?
Date Sat, 29 Jul 2006 19:24:02 GMT

> We have a webapp that needs to support binary updloads from a remove
> fat client: if our client crashes we'd like it to automatically "send" a
> zipped log file to our web application. the delivered file would NOT be
> stored in Tomcat server's file system - but inserted into db.
> Apparently our fat client can issue either a POST or a PUT request. The
> client developer has a slight preference for PUT. I must admit to not
> being familiar with HTTP PUTs - are there any downside to using PUTs
> (aside from having to override doPut())?

I don't think your code will not be any different -- aside from having
to override the doPut() method in your servlet.

However, the HTTP spec has rules that are most strict when using PUT;
you have to respect all of the content-* headers among other things, and
are required to return a 501 NOT IMPLEMENTED if you do not support such

The bottom line is that HTTP PUT appears to have a more robust set of
options, but you really should implement them properly. HTTP POST will
allow you to be a bit lazier in your implementation.


View raw message