Skip to content

Instantly share code, notes, and snippets.

@informz
Created September 16, 2016 15:00
Show Gist options
  • Save informz/97408c74d2de57b6e5ac83444289bfe9 to your computer and use it in GitHub Desktop.
Save informz/97408c74d2de57b6e5ac83444289bfe9 to your computer and use it in GitHub Desktop.
Fetches Inventory
import play.api.libs.json.Json
import play.api.libs.ws.ning.NingWSClient
import scala.concurrent.ExecutionContext.Implicits.global
/**
* Created by ball on 9/16/16.
*/
object InventoryFetcher {
def main(args: Array[String]): Unit = {
val wsClient = NingWSClient()
val postRequest = Json.parse(
"""
{
"channels" : [],
"qtrStartDate" : "26-SEP-2015",
"qtrEndDate" : "25-DEC-2016"
}
""")
wsClient.url("https://inventory-stage.cloudeast.inbcu.com/inventory/extractInventoryData")
.post(postRequest)
.map { inv =>
println(inv.json)
wsClient.close()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment