Hello,

I'd appreciate any tips on how to take POSTed data and use it to save
a new object. Using previous threads here I've figured out how to do
the basic request processing but my limited knowledge of Mapper and
Scala's maps mean that I'm not sure how exactly to save the data I
receive. I'm guessing that I need to use some sort of for
comprehension to assign all the POST parameters to the object.

Here is what I have:

object RestAPI extends XMLApiHelper {
  def dispatch: LiftRules.DispatchPF = {
        case r @ Req("api" :: "packet" :: Nil, "", PostRequest) => () =>
addPacket(r)
  }
  def addPacket(req: Req): LiftResponse = {
        val packet = Packet.create
        /* I want to assign the contents of req.params - Map("node" ->
List("44"), "temp" -> List("24.32525")) - into packet */
        packet.save
        OkResponse
  }
}

Thanks,
Peter Robinett
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to