def METHOD_NAME(self):
    from google.cloud import _http as base_http
    http = mock.create_autospec(requests.Session, instance=True)
    response = requests.Response()
    response.status_code = 200
    data = b"brent-spiner"
    response._content = data
    http.request.return_value = response
    client = mock.Mock(_http=http, spec=["_http"])
    conn = self._make_one(client)
    conn.user_agent = "my-application/1.2.3"
    req_data = "req-data-boring"
    result = conn.api_request("GET", "/rainbow", data=req_data, expect_json=False)
    self.assertEqual(result, data)
    expected_headers = {
        "Accept-Encoding": "gzip",
        base_http.CLIENT_INFO_HEADER: conn.user_agent,
        "User-Agent": conn.user_agent,
    }
    expected_uri = conn.build_api_url("/rainbow")
    http.request.assert_called_once_with(
        data=req_data,
        headers=expected_headers,
        method="GET",
        url=expected_uri,
        timeout=self._get_default_timeout(),
    )
    self.assertIn("my-application/1.2.3", conn.user_agent)