문제

I am trying out the Lift web framework, but I am having a hard time understanding a basic aspect.

I have lift 2.5 M4 running on my localhost:8080. How can I make a CURL request with some parameters, for instance localhost:8080?category=apples&name=flowers, get those paremeters inside Scala, perform a Mongo query based on those paremeters and display JSON output for an Ajax client?

A very basic example of creating a page and getting the request header and paremeters would be awesome.

The page must be a REST service type. Which means it's not using Lift's templating system to generate the buttons etc, as the Lift Cookbook examples illustrate.

도움이 되었습니까?

해결책

There is an example at Simply Lift, it should work and give you a JSON / XNK output without involving template system.

If you need get the parameter in your callback, just use net.liftweb.http.S.param(name), it will give you a Box[String], where holds the parameter if it exists.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top