So I'm making a POST request from a CURLOPT script. The header's content-type is set to "text/plain", and it's not multipart(meaning I cannot use request.getParameter("name") to retrieve it..)
Let's say I pass this param1=aa¶m2=moofy¶m3=handz as parameters and I retrieve the post body with the following code..
String post_body = CharStreams.toString(request.getReader()); //This is a GUAVA library.
Problem is, I cannot do request.getParameter("param1") when the header is set as "text/plain".
What I really want to know is if there is some library out there that will parse the post_body string and return a map of the name/value pairs?
So like... HashMap<String, String> parameters = ParseUtil.parse(post_body).
System.out.println(parameters.get("param1")) would yield 'aa'
Thanks guys.