code: def check_required_fields(method, uri, body, field_names):
      
  
      # Check presence of request body
      if body is None:
          raise BadRequestError(method, uri, reason=3,
                                message="Missing request body")
  
      # Check required input fields
      for field_name in field_names:
          if field_name not in body:
              raise BadRequestError(method, uri, reason=5,
                                    message="Missing required field in request "
                                    "body: {}".format(field_name))
docs: Check required fields in the request body.
  
      Raises:
        BadRequestError with reason 3: Missing request body
        BadRequestError with reason 5: Missing required field in request body