code: def wrap_json_params(func):
      
  
      @functools.wraps(func)
      def wrapper(request, *args, **kwargs):
          ctype, pdict = parse_header(request.headers.get('Content-Type', ''))
          if ctype == "application/json":
              request.params = json.loads(request.body.decode("utf-8")) if request.body else None
          return func(request, *args, **kwargs)
      return wrapper
docs: A middleware that parses the body of json requests and
      add it to the request under the `params` key.