Reputation: 215
Is there a way to use a webservice (REST in this case) as the data source for a Lift application? I can find a number of tutorials/examples of using Lift to provide the REST API, but in my case the data is hosted elsewhere and exported as a REST webservice. Pointers to doc are greatly appreciated.
Thanks, Jeff
Upvotes: 4
Views: 834
Reputation: 3285
I use Dispatch (which is a wrapper around HttpClient) for making REST calls. Looks nice and simple
Upvotes: 0
Reputation: 2185
If you really want to be fancy, you can create a Record implementation for a REST-based data source. There's already one of these in existence that works with CouchDB. Using the lift-couchdb module, the interactions with CouchDB are abstracted away and all you deal with is the Scala code. There is a short wiki page with instructions on how to get started with lift-couchdb here:
http://www.assembla.com/wiki/show/liftweb/CouchDB
The pertinent source code files are available here:
Using the Record interface gives you access to lots of Traits which you use to provide functionality with minimal code-writing such as creating HTML forms, providing lifecycle based calls, and easy hooks for validation.
Upvotes: 1
Reputation: 13221
This is not related to Lift in fact. There is a lot of different pieces of information already:
Think about caching thoroughly, it is generally a good choice if your application generates a lot of requests and you can afford caching. Caching will let you achieve many goals:
So you can just sit and put these things together, that's it.
Upvotes: 2
Reputation: 3634
I've put a scala layer over HttpClient and then use that. I've been meaning to put this on github for some time.
Upvotes: 0