Created
October 27, 2011 13:30
-
-
Save jestan/1319535 to your computer and use it in GitHub Desktop.
Dispatch Http Verbs
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 Http._ | |
val http = new Http with thread.Safety with NoLogging | |
val host = :/("localhost", 8080) | |
//GET | |
val resp = http(host / "feed-api" / "app1" / "status" as_str) | |
//POST | |
def extractResp(json: String) = { /*... */ } | |
val resp = http(host / "feed-api" / "subscribe" / "app1" | |
<< (""" { "userId" : 12233 } """, "application/json") | |
>- { extractResp(_)}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dispatch Periodic Table
http://www.flotsam.nl/dispatch-periodic-table.html