Make get_request_data take into account the content-type header
If the user has specified a content-type, we can assume that they really
wanted to pass us a JSON blob and thus we can force the
flask.request.get_json() method.
This reduces the code duplication
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>