Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7283] Android: Support Synchronous HTTPClient calls

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 1.8.0.1, Release 1.8.3
Fix Version/sn/a
ComponentsAndroid
Labelscore
ReporterEduardo Gomez
AssigneeEric Merriman
Created2012-01-18T16:06:49.000+0000
Updated2018-08-02T17:31:43.000+0000

Description

Feature Request

The purpose of this feature request is to support Synchronous HTTP Calls on android as currently is in iOS.

HTTPClient method

http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Network.HTTPClient.open-method.html

Repro sequence to test

Pass a third argument (true/false) to open()
var bool, xhr;
  xhr = Titanium.Network.createHTTPClient();
  bool = false;
  xhr.open("GET", "http://api.twitter.com/1/help/test.json", false);
  xhr.onreadystatechange = function() {
    Ti.API.debug("Ready State change to " + xhr.status);
    if (xhr.status === 200) {
      Ti.API.debug("Setting bool to true");
      bool = true;
    }
  };
  xhr.send();
  Ti.API.debug("Bool is: " + bool);

Output

D/TiAPI ( 304): Bool is: false

Comments

No comments

JSON Source