I have a function, with the signature:
async fn index(bearer_control: web::Json<BearerControl>) -> Result<String> {
It is used an a web server:
HttpServer::new(|| App::new().route("/", web::post().to(index)))
.bind_openssl("127.0.0.1:1618", builder)?
.run()
.await
I want to return a 204 No Content.
I've tried returning an empty string, but that is still a 200 OK.
What sort of function return type do I need from index()
and how do I attach a function with a different return type to the server?