'Serializes the wrapped object.
Utility method for serializing the wrapped object.  Returns a
webob.Response object.'

def serialize(self, request, content_type):

    serializer = self.serializer
    body = None
    if (self.obj is not None):
        body = serializer.serialize(self.obj)
    response = webob.Response(body=body)
    if response.headers.get('Content-Length'):
        response.headers['Content-Length'] = utils.utf8(response.headers['Content-Length'])
    response.status_int = self.code
    for (hdr, value) in self._headers.items():
        response.headers[hdr] = utils.utf8(value)
    response.headers['Content-Type'] = utils.utf8(content_type)
    return response
