def MakeRequest(self, data):
    """Make a HTTP Post request to the server 'control' endpoint."""
    stats.STATS.IncrementCounter("grr_client_sent_bytes", len(data))

    # Verify the response is as it should be from the control endpoint.
    response = self.http_manager.OpenServerEndpoint(
        path="control?api=%s" % config_lib.CONFIG["Network.api"],
        verify_cb=self.VerifyServerControlResponse,
        data=data, request_opts={"Content-Type": "binary/octet-stream"})

    if response.code == 406:
      self.InitiateEnrolment()
      return response

    if response.code == 200:
      stats.STATS.IncrementCounter("grr_client_received_bytes",
                                   len(response.data))
      return response

    # An unspecified error occured.
    return response
dataset/ETHPy150Open google/grr/grr/client/comms.py/GRRHTTPClient.MakeRequest/original