score:0

It seems I misunderstood your problem. Now it seems you had problem with the getSensorList, not how to handle the result.

Here is my take:

def getSensorList(uuid:String): Future[String] = {
    val svc = url("https://example_api.com/services/api/v1/sensors/" + uuid + "/")
    val response : Future[String] = Http(svc OK as.String)
    response
}

I have kept the response variable just in case you want to debug or further process before you return. The problem was that you just declared the result you want to return, but not returned. (= returns Unit, in Scala the assignment do not return the right hand side expression.) You are right that the Unit is kind of nothing (but not Nothing!), if you are familiar with Java/C/C++/C#, the equivalent is void (in Python it is I think None).


Related Query

More Query from same tag