code: def response(request, status, obj):
      
      request.setResponseCode(status)
      request.responseHeaders.setRawHeaders(
          u"content-type", [u"application/json"],
      )
      body = dumps_bytes(obj)
      return body
docs: Generate a response.
  
      :param IRequest request: The request being responsed to.
      :param int status: The response status code to set.
      :param obj: Something JSON-dumpable to write into the response body.
  
      :return bytes: The response body to write out.  eg, return this from a
          *render_* method.