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

HTTPClient compliance with XMLHttpRequest specifications

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Release 7.0.0, Release 8.0.2
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Description

      function getXhr() {
        if (typeof Ti !== 'undefined') {
            return Ti.Network.createHTTPClient();
        }
        if (typeof XMLHttpRequest) {
            return new XMLHttpRequest();
        }
        throw Error('Unknown environment');
      }
      var xhr = getXhr();
      xhr.onload = function () {console.log('onload' + ' ' + xhr.status)};
      xhr.onerror = function () {console.log('onerror' + ' ' + xhr.status)};
      xhr.addEventListener('load', function() {console.log('load' + ' ' + xhr.status)});
      xhr.addEventListener('error', function() {console.log('error' + ' ' + xhr.status)});
       
      xhr.open('GET', 'http://www.httpbin.org/status/400'); //returns 400 status
      xhr.send();
      

      Console output in browser:

      onload 400
      load 400
      

      Output in Titanium:

      onerror

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              s.volkov Sergey Volkov
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code