ps: some times the xmlDoc is just one of the request parameters, other times it is the post body [ March 02, 2006: Message edited by: Rajagopal Manohar ]
Author and all-around good cowpoke
Joined: Mar 22, 2000
Since you can't change the way requests are created, it looks to me like you will have to grab the contents of the input stream to a byte, grab all the header information to some sort of Map, and then decide what to do with it. I say byte because that leaves you the flexibility to handle data as binary or as characters. If there was something in the request headers that could let you decide how to treat the body of the POST you could use a Filter to look at the headers and direct the request to the appropriate servlet. Bill
Joined: Nov 26, 2004
Originally posted by Rajagopal Manohar: looks like HttpUtils class will do what I was looking for. But its deprecated any idea why and alternatives if any will be helpfull
Thanks in advance, Raj
Thanks for the replys,
I am using this class as it seems to do what I want read a string and return a hashtable of parameters or throw a exception. Is there any thing that can go wrong with this approach?
If there was something in the request headers that could let you decide how to treat the body of the POST you could use a Filter to look at the headers and direct the request to the appropriate servlet. Bill
Yes, if the clients are at all well written then they will adhere to the HTTP spec and send you a "Content-Type" request header. If it's application/x-www-form-urlencoded then you should look for the data in a request parameter. If it's text/xml then you would know to parse the body of the message as XML.