code: def _writeResponse(self, response, request, status=200):
          
          request.setResponseCode(status)
          if self.encoding is not None:
              mimeType = 'text/xml; charset="%s"' % self.encoding
          else:
              mimeType = "text/xml"
  
          request.setHeader("Content-Type", mimeType)
          request.setHeader("Content-Length", str(len(response)))
          request.write(response)
          request.finish()
docs: request -- request message
          response --- response message
          status -- HTTP Status