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

Windows -HTTPClient - responseText is not cleared between two requests

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 6.0.4
    • Fix Version/s: Release 6.1.0
    • Component/s: Windows
    • Environment:
    • Story Points:
      5
    • Sprint:
      2017 Sprint 09 SDK

      Description

      I use the HTTPClient to do a service request.
      Doing simultaneous http request , the responseText holds values of the first request.
      As a result the values gets duplicated.
      Below is the code.

      var count =0;
        var client = Ti.Network.createHTTPClient();
        client.onerror = function(e){
         
        };
        client.onload = function(e){
         count = count + 1;
         console.log("Server executed " + count + " time(s)");
         console.log(client.responseText);
         if(count != 2){
          client.open("GET", "https://httpbin.org/get");
          client.send();
         }
        };
        client.setTimeout(60000);
        client.validatesSecureCertificate = false;
        client.open("GET", "https://httpbin.org/get");
        client.send();
      

      The response of the above as below


      [INFO] : Server executed 1 time(s)
      [INFO] : {
      [INFO] : "args": {},
      [INFO] : "headers":

      { [INFO] : "Accept-Encoding": "gzip, deflate", [INFO] : "Connection": "close", [INFO] : "Host": "httpbin.org", [INFO] : "User-Agent": "Appcelerator Titanium/6.0.3.GA (Microsoft Virtual/6.3.9651.0; windowsphone; English_United States.1252;)", [INFO] : "X-Titanium-Id": "49c36bc6-4470-4689-9111-a81411c54643" [INFO] : }

      ,
      [INFO] : "origin": "182.75.8.94",
      [INFO] : "url": "https://httpbin.org/get"
      [INFO] : }

      [INFO] : Server executed 2 time(s)
      [INFO] : {
      [INFO] : "args": {},
      [INFO] : "headers":

      { [INFO] : "Accept-Encoding": "gzip, deflate", [INFO] : "Connection": "close", [INFO] : "Host": "httpbin.org", [INFO] : "User-Agent": "Appcelerator Titanium/6.0.3.GA (Microsoft Virtual/6.3.9651.0; windowsphone; English_United States.1252;)", [INFO] : "X-Titanium-Id": "49c36bc6-4470-4689-9111-a81411c54643" [INFO] : }

      ,
      [INFO] : "origin": "182.75.8.94",
      [INFO] : "url": "https://httpbin.org/get"
      [INFO] : }
      [INFO] : {
      [INFO] : "args": {},
      [INFO] : "headers":

      { [INFO] : "Accept-Encoding": "gzip, deflate", [INFO] : "Connection": "close", [INFO] : "Host": "httpbin.org", [INFO] : "User-Agent": "Appcelerator Titanium/6.0.3.GA (Microsoft Virtual/6.3.9651.0; windowsphone; English_United States.1252;)", [INFO] : "X-Titanium-Id": "49c36bc6-4470-4689-9111-a81411c54643" [INFO] : }

      ,
      [INFO] : "origin": "182.75.8.94",
      [INFO] : "url": "https://httpbin.org/get"
      [INFO] : }

      Please let me know if you need more information.

        Attachments

          Activity

            People

            • Assignee:
              kiguchi Kota Iguchi
              Reporter:
              jsubramanian JSubramanian
              Reviewer:
              Gary Mathews
              Tester:
              Samir Mohammed
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code