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

Windows: Calling send with data will upgrade from a GET to a POST

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 6.1.2, Release 6.2.0
    • Fix Version/s: Release 7.0.0
    • Component/s: Windows
    • Labels:
    • Environment:

      Ti SDK: 6.1.2.GA, 6.2.0.GA

    • Story Points:
      3
    • Sprint:
      2017 Sprint 22 SDK, 2017 Sprint 23 SDK

      Description

      Description

      When performing a GET request and providing the optional data param the SDK will upgrade the request from GET to POST, this isn't in line with other platforms and causes problems for modules like ti.cloud which always send an empty data object

      var win = Ti.UI.createWindow({
          title: 'stuff',
          backgroundColor: '#fff'
      });
       
      var label = Ti.UI.createLabel({
          text: 'click me',
          color: "#333",
          font: {
              fontSize: 20
          }
      });
       
      label.addEventListener('click', function() {
          var url = 'https://httpbin.org/anything';
          var client = Ti.Network.createHTTPClient({
              onload : function(e) {
                  alert("method was: " + JSON.parse(this.responseText).method);
                  Ti.API.info(this.responseText);
              },
              onerror : function(e) {
                  Ti.API.debug(e.error);
                  alert('error');
              },
              timeout : 5000
          });
          client.open("GET", url);
          client.send({foo:'bar'});
      })
       
      win.add(label);
      win.open()
      
      

      Steps to reproduce
      1. Add the above code to an existing app.js and build for Windows
      2. Tap the label
      Actual

      Request is changed to a POST

      Expected

      Request should stay as get

        Attachments

          Activity

            People

            • Assignee:
              eharris Ewan Harris
              Reporter:
              eharris Ewan Harris
              Reviewer:
              Kota Iguchi
              Tester:
              Josh Longton
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code