Google App Engine seems to confuse Android Post with Get over HTTPClient

This is odd. It's only happening with Android platforms. iOS uses the same code and is recognized correctly as a Post. Running with Android 2.3.3 SDK, compiled for API 10 on Titanium 3.0.0.GA.

The code is textbook from the examples in the documentation. This below obviously isn't my code, but all the elements are the same. The request method for Android is always read as a GET on GAE. iOS request methods are acknowledged as POST with this code.

var my_xhr = Titanium.Network.createHTTPClient();'POST','');


my_xhr.setRequestHeader('Content-Type', 'text/json; charset=utf-8');
  'master_stack': JSON.stringify(object_type_variable),

I've seen a number of similar posts in Q&A – all with conflicting (bad) advice. Anyone familiar with this issue?

— asked 3 years ago by Francis Meetze
  • Are you getting a 302/redirect in between? My guess is that you are issuing a POST and then getting a 302 which is followed by a GET. Run a trace and confirm. If so I will post the answer.

    — commented 3 years ago by David Bankier
  • Thanks Dave. No, the status is 200. See the GAE printout in the answer below. I understand this is an error that's been filed in Jira:

    — commented 3 years ago by Francis Meetze
  • Hi David, you peaked my curiosity. I tried to search for some references on the 302/redirect and didn't come up with anything. I'm still interested in your answer. :)

    — commented 3 years ago by Francis Meetze

1 Answer

  • Try android 4.2 if the problem persists inform us.

    — answered 3 years ago by Michael Massalas
    1 Comment
    • Great suggestion! I needed to do that anyhow. Unfortunately, I have the same sob story with 4.2.
      Here's GAE's log:

          2012-12-21 11:49:19.870 /mobileupdate/masterstack/ 200 62ms 0kb
 - - [21/Dec/2012:11:49:19 -0800] "GET /mobileupdate/masterstack/ HTTP/1.1" 200 34 - - "" ms=62 cpu_ms=43 cpm_usd=0.000004 instance=00c61b117c875688bee715982d2ec4e0059e41
          W 2012-12-21 11:49:19.867
          request method: GET

      — commented 3 years ago by Francis Meetze