def __init__(self, req, result=None, code=None, headers=None, **kwargs):
        """
        Initialize a ResponseObject.

        :param req: The request associated with the response.
        :param result: The optional result.
        :param code: The HTTP response code.  If not specified, the
                     default set by the @action() decorator will be
                     used.  If no default was specified by @action(),
                     then the default will be 200.
        :param headers: A dictionary of headers for the response.
                        Note that keys will be handled in a
                        case-insensitive manner.
        """

        # Store the request, result, code, and headers
        self.req = req
        self.result = result
        self._code = code
        self._headers = {}
        if headers:
            self.update(headers)

        # Set up various defaults
        self._defcode = None
        self.content_type = None
        self.type_name = None
        self.serializer = None

        # If a method was specified, bind it; this prepares for
        # serialization and updates the default code
        if '_descriptor' in kwargs:
            self._bind(**kwargs)
def __init__ ( self , req , result = None , code = None , headers = None , ** kwargs ) : self . req = req self . result = result self . _code = code self . _headers = { } if headers : self . update ( headers ) self . _defcode = None self . content_type = None self . type_name = None self . serializer = None if '_descriptor' in kwargs : self . _bind ( ** kwargs )
Initialize a ResponseObject.

        :param req: The request associated with the response.
        :param result: The optional result.
        :param code: The HTTP response code.  If not specified, the
                     default set by the @action() decorator will be
                     used.  If no default was specified by @action(),
                     then the default will be 200.
        :param headers: A dictionary of headers for the response.
                        Note that keys will be handled in a
                        case-insensitive manner.