Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Synchronous httpclient

I'm using the android SDK at the moment and I am trying to do a synchronous httpclient request, unfortunately no matter how I set the 3rd parameter of xhr.open() it always works asynchronously.

Am I missing something or is this messed up at the moment?

— asked April 9th 2010 by JT Jankowiak
  • 1.2
  • android
  • httpclient
  • mobile
  • synchronous
1 Comment
  • For future reference, the doc for HTTPClient now reads: The Android platform does not support synchronous requests.

    — commented December 20th 2013 by Michael Stelly

5 Answers

  • Just my 2 cents, but you should REALLY update the documentation (or even better, the Network open() function) so that people (like me) don't try to make synchronous calls.

    It's a pain to read something in the doc, which is actually not right and to lose 2 hours trying to figure it out (before finding this post :/)


    — answered September 28th 2010 by HMax
    1 Comment
    • Glad I saw this! WTF?

      — commented June 8th 2011 by Anthony Sosso
  • The documentation for http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Network.HTTPClient.open-method.html should be updated to note that the third parameter is meaningless and has no effect.

    — answered March 3rd 2011 by jeffrey wong
  • We only provide asynchronous access. Given the slow speed of connections, the UI would hang and cause the OS to throw up the kill or wait dialog.

    — answered April 9th 2010 by Don Thorp
  • I added Ticket 2021 to track the suggestion.

    — answered October 6th 2010 by Don Thorp
  • Why is this not documented ?

    — answered February 3rd 2011 by Paul Krefta
    1 Comment
    • Did you look at Don's post? A ticket was created to update the documentation and that was resolved on Jan 21. See this page for the changes. I suspect though that changes the 1.6.x docs, not the 1.5.x docs you see now. As mentioned here, it sounds like 1.6.x will go GA later this month.

      — commented February 3rd 2011 by Doug Handy
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.