Ok, i found out that the POSTed JSON was in S.params("results").first,
which contains:
Full(Map(name -> New Content, language -> en, content -> , id -> ext-
record-1))
So i tried this:
for ((key, value) <- JSONParser.parse(S.params("results").first)) {
Log.error(key + " -> " + value)
}
But it doesn't go through the loop. I guess it has something to do
with the Full() around the Map.
I tried .elements on the returned Full() for an iterable, but it still
doesn't run through the loop.
Any ideas?
On Jul 15, 9:01 am, fbettag <[email protected]> wrote:
> I just noticed i forgot a } after 'baz' ;)
>
> Thanks for your replies
>
> On Jul 14, 6:59 pm, Jeppe Nejsum Madsen <[email protected]> wrote:
>
>
>
> > fbettag <[email protected]> writes:
> > > Heyho,
>
> > > any ideas how i can parse data that was posted as JSON?
> > > For example:
> > > {foo: [{bar: 'shiz'}, {bar: 'baz']}
>
> > The above is not strictly JSON, but JSONParser.parse seems to handle
> > this as well:
>
> > scala> import net.liftweb.util._
> > import net.liftweb.util._
>
> > scala> JSONParser.parse("{foo: [{bar: 'shiz'}, {bar: 'baz']}")
> > res0: net.liftweb.util.Box[Any] = Full(Map(foo -> List(Map(bar -> shiz))))
>
> > /Jeppe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---