Created
March 6, 2014 02:46
-
-
Save brentsowers1/9381281 to your computer and use it in GitHub Desktop.
Making an HTTP Request with Dispatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dispatch._ | |
import net.liftweb.json._ | |
val h = new Http | |
val req = url("https://api.github.com/users/brentsowers1/repos") | |
// Gets both the headers and response body | |
val rspStr = h(req >:+ { (headers, req) => | |
val hdrs = headers | |
req as_str | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment