def read_parameters(request, view_kwargs=None, capture_errors=False):  
if view_kwargs is None:<EOL><INDENT>view_kwargs = {}<EOL><DEDENT>params = {}<EOL>errors = {}<EOL>for param in request.api_info.operation.parameters:<EOL><INDENT>try:<EOL><INDENT>value = param.get_value(request, view_kwargs)<EOL>if value is NO_VALUE:<EOL><INDENT>if param.has_default:<EOL><INDENT>params[param.name] = param.default<EOL><DEDENT>elif param.required:  <EOL><INDENT>errors[param.name] = MissingParameter('<STR_LIT>' % param.name)<EOL><DEDENT>continue  <EOL><DEDENT>params[param.name] = param.cast(request.api_info.api, value)<EOL><DEDENT>except (NotImplementedError, ImproperlyConfigured):<EOL><INDENT>raise<EOL><DEDENT>except Exception as e:<EOL><INDENT>if not capture_errors:<EOL><INDENT>raise<EOL><DEDENT>errors[param.name] = e<EOL><DEDENT><DEDENT>if errors:<EOL><INDENT>raise ErroneousParameters(errors, params)<EOL><DEDENT>return params<EOL>
:param request: HttpRequest with attached api_info
:type request: HttpRequest
:type view_kwargs: dict[str, object]
:type capture_errors: bool
:rtype: dict[str, object]