def create_request(self, method, args=None, kwargs=None, one_way=False):
        """Creates a new :py:class:`JSONRPCRequest` object.

        Called by the client when constructing a request.
        JSON RPC allows either the ``args`` or ``kwargs`` argument to be set.

        :param str method: The method name to invoke.
        :param list args: The positional arguments to call the method with.
        :param dict kwargs: The keyword arguments to call the method with.
        :param bool one_way: The request is an update, i.e. it does not expect a reply.
        :return: A new request instance.
        :rtype: :py:class:`JSONRPCRequest`
        :raises InvalidRequestError: when ``args`` and ``kwargs`` are both defined.
        """
        if args and kwargs:
            raise InvalidRequestError(
                'Does not support args and kwargs at '
                'the same time'
            )

        request = self.request_factory()
        request.one_way = one_way

        if not one_way:
            request.unique_id = self._get_unique_id()

        request.method = method
        request.args = args
        request.kwargs = kwargs

        return request