Created
May 2, 2014 10:16
-
-
Save Codesleuth/6444130f4f67c513eda3 to your computer and use it in GitHub Desktop.
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
package main | |
import dispatch._, Defaults._ | |
object DispatchMessage extends App { | |
def DispatchRequest(reference: String, body: String, to: String): scala.xml.Elem = <messages> | |
<accountreference>{ reference }</accountreference> | |
<message> | |
<to>{ to }</to> | |
<body>{ body }</body> | |
</message> | |
</messages> | |
val messageBody = DispatchRequest("EX0012345", "hello world!", "447896541230").toString() | |
val request = url("http://api.esendex.com/v1.0/messagedispatcher").as("[email protected]", "password").POST << messageBody | |
val requestPromise = Http(request OK as.xml.Elem) | |
val result = requestPromise() | |
println(result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment