code: def request_payload(cls, request, request_id):
          '''JSON v2 request (or notification) payload.'''
          payload = {
              'jsonrpc': '2.0',
              'method': request.method,
          }
          # A notification?
          if request_id is not None:
              payload['id'] = request_id
          # Preserve empty dicts as missing params is read as an array
          if request.args or request.args == {}:
              payload['params'] = request.args
          return payloaf request_payload(cls, request, request_id):
          '''JSON v2 request (or notification) payload.'''
          payload = {
              'jsonrpc': '2.0',
              'method': request.method,
          }
          # A notification?
          if request_id is not None:
              payload['id'] = request_id
          # Preserve empty dicts as missing params is read as an array
          if request.args or request.args == {}:
              payload['params'] = request.args
          return payload
docs: JSON v2 request (or notification) payload.