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

iOS: HTTPclient sends additional post request on receipt of 401 error

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
    • Story Points:
      5
    • Sprint:
      2018 Sprint 05 SDK

      Description

      When making a POST request with httpClient and the resource returns a 401 error, a second POST request is being made automatically. Similar issues have previously been reported (and resolved) with Android, but not iOS.

      var httpClient = Ti.Network.createHTTPClient({	
        onload: function(e) {
          // This function is not triggered with the 401 response code
        },		
        onerror: function(e) {		
          // This function is triggered with the 401 response code, but a second POST is also made
        },
        onreadystatechange: function(e) {
          Ti.API.warn(this.readyState);
          // 1
          // 3
          // 3
          // 4
          // 4
        },
        timeout: 2000		
      });
       
      httpClient.open('POST', 'https://httpstat.us/401');
      

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              Ian.taylor@fraigneux.com Ian Taylor
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code