Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19591

createHttpClient GET request, when 404 Android onError http error code not received

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Mac OSX 10.9.5, Titanium Studio, build: 3.3.0.201407100905

    • Story Points:
      1

      Description

      Create a new httpClient request, GET. In the onError callback ask for the http response code.

      Purposely make the URL to send a 404 not found

      IOS, simulator and device, you will get the 404 code, and any error handling will execute.

      Android will fail on both simulator and device. Http code returned is -1. You will also see an httpclient error in the console.

      Sample index.js code

       
      var dataUrl = "http://www.whateverdomain.com/404page"; // add your 404 test URL here
       
      function httptest()
      {
      	
      	var xhr = Ti.Network.createHTTPClient({
      		onload: function()
      		{
      			// whatever....
      		},
      		onerror: function(e) {
      			Ti.API.info(e.code);
      		},
      		timeout: 60000
      	
      	});
      	
      	xhr.open('GET', dataUrl);
      	xhr.send();
      }
       
      function init()
      {
      	$.index.open();
      	 httptest();
      }
       
      init();
       
       
      
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              capsizeno4 eric harms
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20403
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration