Freewind
Freewind

Reputation: 198228

How to post to an http api and get the JSON data back, in lift?

I'm new to lift, and now I want to visit an external http api, post some data and get the JSON data back.

The information is:

url: http://mytest.com/login
method: post
accept: application/json
params: {
           "username":"username",
           "password":"password"
        }

response: {
              "result":"ok/failed",
              "message":"welcome/failure reason"
          }

Since this is a lift project, and you know lift has provided many useful libraries. I wonder if lift has provided some functions to do this?

If not, is it any other good scala libraries I can use? Or do I have to use apache's java http-client library?

Upvotes: 0

Views: 666

Answers (1)

jcern
jcern

Reputation: 7848

To the best of my knowledge, Lift does not have any built in functionality for handling requests to external services.

I'd recommend taking a look at Dispatch. It has many great libraries for abstracting the HTTP interaction and is totally Scala based.

Upvotes: 2

Related Questions