@tornado.web.asynchronous
  def post(self):
    """ A POST handler for request to this server. """
    request = self.request
    http_request_data = request.body
    pb_type = request.headers['protocolbuffertype']
    if pb_type == "Request":
      response = self.search_service.remote_request(http_request_data)
    else:
      response = self.search_service.unknown_request(pb_type)

    request.connection.write_headers(
      tornado.httputil.ResponseStartLine('HTTP/1.1', 200, 'OK'),
      tornado.httputil.HTTPHeaders({"Content-Length": str(len(response))}))
    request.connection.write(response)
    request.connection.finish()
dataset/ETHPy150Open AppScale/appscale/SearchService/search_server.py/MainHandler.post/original