title: GET request google
body: <p>I'm trying to implement a simple web browser in C.
  When ever I send a get request to google.com using</p>
  
  <pre><code>    GET / HTTP/1.1\r\n\r\n
  </code></pre>
  
  <p>I receive</p>
  
  <pre><code>HTTP/1.1 302 Found
  Cache-Control: private
  Content-Type: text/html; charset=UTF-8
  Location: http://www.google.co.in/?gfe_rd=cr&amp;ei=1wIjWPqZA6DmugSY4I-IDw
  Content-Length: 261
  Date: Wed, 09 Nov 2016 11:04:55 GMT
  
  &lt;HTML&gt;&lt;HEAD&gt;&lt;meta http-equiv="content-type" content="text/html;charset=utf-8"&gt;
  &lt;TITLE&gt;302 Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;
  &lt;H1&gt;302 Moved&lt;/H1&gt;
  The document has moved
  &lt;A HREF="http://www.google.co.in/?gfe_rd=cr&amp;amp;ei=1wIjWPqZA6DmugSY4I-IDw"&gt;here&lt;/A&gt;.
  &lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>
  
  <p>Subsequently I send another GET request</p>
  
  <pre><code>GET /?gfe_rd=cr&amp;amp;ei=1wIjWPqZA6DmugSY4I-IDw HTTP/1.1\r\n\r\n
  </code></pre>
  
  <p>And I receive error code 404 not found.</p>
  
  <p>If not this, what should be the GET request to redirect me to the site. I find ip address of google using</p>
  
  <pre><code>char *hostname = "www.google.com";
  struct hostent *he;
  he = gethostbyname( hostname );
  </code></pre>