Servlet parameters and doPut

Based on comments and further research I realized that the Servlet cannot assume anything about the data being put onto the server and therefore, will not parse name/value pairs.

The following solution seems to be the proper way to handle any data passed via PUT, and can be parsed as XML, Name/Value, or whatever.

BufferedReader br = new BufferedReader(new InputStreamReader(req.getInputStream());

String data = br.readLine();

Leave a Comment