Fix the handling of the Content-Type header in REST

The Content-Type header is optional and might not be sent, so don't rely
on its existence.

Signed-off-by: Xavier Trochu <xavier.trochu@edpsciences.org>