问题描述:

I'd like to make a simple client that uses the Rdio API. What are my options as far as libraries go? I know of Dispatch and the WS library in Play.

Are there any others?

网友答案:

To be honest, I searched around and tried a few but found I was much happier using Apache HttpClient and Jackson (JSON), and jackson-module-scala directly, with some small helper classes.

Apache HttpComponents: http://hc.apache.org/

jackson-module-scala: https://github.com/FasterXML/jackson-module-scala

This is likely not the answer you were looking for, but I found that different REST APIs I was integrating with had various quirks and differences that made it hard to find the "perfect" abstraction library beyond that, and Scala makes it very easy to write your own useful traits to support this. E.g.:

val (statusCode, json) = getJsonFrom(url, ("Authorization" -> auth))
assert(statusCode == OK)
...

If you don't get a better answer, I can place some example code on GitHub when I get a chance if you are interested.

相关阅读:
Top