Dispatch is returning a Future
for the Array[Byte]
to you, so you need to apply the Future in order to get the Array[Byte]
. Try changing the following line:
val img = Http(svc OK as.Bytes)()
Notice that I added a ()
to the end of that line. This will apply the Future
, blocking and waiting for the result. Blocking is not ideal, and the dispach Future
also supports async callbacks, but this works for the purpose of your example to show what was missing.