title: Http GET request on Google.Com returns "Error 302 page has been moved"
body: <p>I am trying to mess around with mobile development using Marmalade SDK. I am currently trying to accomplish various tasks using IwHTTP. I have been able to replicate my particular problem on the <a href="http://www.google.com" rel="nofollow">http://www.google.com</a> URL. What happens is that my code will output the source code for a "302 error" page instead of the standard Google page. This is not my specific problem (i.e. I could not care less about Google) but this replicates my issue with another website.</p>
  
  <p>I have tried to look around the web to find about this issue but only found issues related to malware. I do not think this is an issue of using the library. This is most probably my lack of understanding of HTTP that is biting me here. Here is the short snippet that will produce this error.</p>
  
  <pre><code>#include "s3e.h"
  #include "IwGx.h"
  #include "IwHTTP.h"
  #include &lt;string&gt;
  
  int32 rec = 0;
  CIwHTTP http;
  std::string output = "";
  char buffer[1024];
  
  int32 min(int32 a, int32 b) { return a &gt; b ? b : a; }
  
  int32 http_get_callback(void* sys_data, void* user_data) {
      if(http.ContentReceived() &lt; http.ContentLength()) {
          http.ReadData(buffer, min(1024, http.ContentLength() - http.ContentReceived()));
          output += buffer;
      }
  }
  
  int main()
  {
      IwGxInit();
  
      IwGxSetColClear(0, 0, 0xff, 0xff);
  
      http.Get("https://www.google.com", http_get_callback, 0);
  
      while(!s3eDeviceCheckQuitRequest() &amp;&amp; 
              !s3eKeyboardGetState(s3eKeyEsc) &amp; S3E_KEY_STATE_DOWN &amp;&amp;
              !s3eKeyboardGetState(s3eKeyAbsBSK) &amp; S3E_KEY_STATE_DOWN)
      {
          IwGxClear();
          IwGxPrintString(5, 5, output.c_str());
          IwGxFlush();
          IwGxSwapBuffers();
          s3eDeviceYield(0);
      }
      IwGxTerminate();
      return 0;
  }
  </code></pre>
  
  <p>I have also tried variants (with or without SSL, with .com and .ca) and I could not get the expected output.</p>
  
  <p>Any pointer on this issue ?</p>
  
  <p>Edit: And I do know this code is most probably horrible, this is just test code to learn the SDK.</p>