Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Put request

 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I use put request?Can I give the method in form as put?In that case how will I send the resource, which I want to put on the server?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PUT and DELETE can not be used with forms. For some further information, have a look here and here.
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That means I cant send a put request to the server?How else can I send a document to the server?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can most definitely use PUT, just not from inside an HTML form. As the articles I linked to mention, there are several options for the client side, e.g. Jakarta Commons HttpClient (or even java.net.HttpUrlConnection) or the XmlHttpRequest in JavaScript (although JavaScript can't interact with files, of course). On the server side you can use the standard servlet API (the HttpServlet class has doXYZ methods for all HTTP methods, including PUT and DELETE).

Other ways of handling files on the server would be WebDAV, which is shipped with Tomcat, or the standard HTTP file upload described here.
[ January 03, 2007: Message edited by: Ulf Dittmer ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic