Is there a way to send a vector (array) through a HttpResponse with actix_web?
I can send strings in the body completely fine and was hoping to send an array for the client to receive and store.
This is my currently used code snippet which responds with an error in the .body(data):
let smembers_check = database::smembers(info.key).ok();
if smembers_check != None
{
let data = smembers_check.unwrap();
HttpResponse::Ok().body(data)
}
else
{
HttpResponse::Ok().body("")
}
Is there a solution to this? Thanks in advance.
Return HttpResponse in handler signature and return data like this: HttpResponse::Ok().json(data)