title: HTTP Request using Google API Client Library for C++
body: <p>I am trying to send an HTTP GET Request using Google API Client Library for C++ using the use case examples mentioned at <a href="http://google.github.io/google-api-cpp-client/latest/guide/making_http_requests.html" rel="nofollow">http://google.github.io/google-api-cpp-client/latest/guide/making_http_requests.html</a>.</p>
  
  <p>Here's my program:</p>
  
  <pre><code>#include "googleapis/client/data/data_reader.h"
  #include "googleapis/client/transport/http_request.h"
  #include "googleapis/client/transport/http_response.h"
  #include "googleapis/client/transport/http_transport.h"
  #include "googleapis/client/transport/curl_http_transport.h"
  #include "googleapis/base/scoped_ptr.h"
  #include "googleapis/base/mutex.h"
  #include &lt;curl/curl.h&gt;
  #include &lt;glog/logging.h&gt;
  #include "googleapis/util/status.h"
  #include &lt;iostream&gt;
  #include &lt;cstring&gt;
  #include &lt;cstdlib&gt;
  
  using namespace googleapis;
  using namespace std;
  
  using googleapis::client::HttpRequest;
  using googleapis::client::HttpRequestState;
  using googleapis::client::HttpResponse;
  using googleapis::client::HttpTransport;
  using googleapis::client::HttpTransportLayerConf;
  using googleapis::client::HttpTransportOptions;
  
  void IllustrateGet(const char* url, HttpTransport* transport) {
      scoped_ptr&lt;HttpRequest&gt; request(
              transport-&gt;NewHttpRequest(HttpRequest::GET));
      request-&gt;set_url(url);
      util::Status status = request-&gt;Execute();
      if (!status.ok())
          cerr &lt;&lt; status.error_message();
  }
  
  
  int main(){
  
      string url = "http://www.google.com/cloudprint";
      scoped_ptr&lt;HttpTransport&gt; transport;
  
      IllustrateGet(url, transport);
      return 0;
  
  }
  </code></pre>
  
  <p>In main(), when I try to invoke the IllustrateGet function, I get an invalid argument exception. Could some one help me understand what does HttpTransport do in order to send an HTTP GET Request?</p>