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

HTTP PUT method fails with SDK 1.4.0 due to url-encoded path

    Details

      Description

      {html}<div><p>We upgraded to Titanium Mobile SDK from 1.3.0 to 1.4.0 and use
      the same code base, but the effect differs.</p>
      <p>Trying to perform a HTTP request with PUT method fails and
      results always in call of onerror and in a 404 errorcode.<br>
      Due to Wireshark analysis of HTTP request, we figured out that the
      path part of uri is url-encoded now.</p>
      <p>Requests towards uris like<br>
      <a href=
      "http://www.ourdomain.com/our,comma,separated,path/">http://www.ourdomain.com/our,comma,separated,path/</a><br>
      will not work anymore in titanium mobile sdk 1.4.0</p>
      <p>Following code snippet works with 1.3.0 on iOS 3.1.3 and does
      not work with 1.4.0 on iOS 4.0.1</p>
      <pre>
      <code> var xhrPut = Titanium.Network.createHTTPClient();
      xhrPut.onload = function()
      {
      if (this.status===204){ log("calling succes callback."); }else{ log("error loading "+this.status+" "+this.responseData); }
      };
      xhrPut.onerror = function()
      { log("error loading "+this.status+" "+this.responseData); };

      xhrPut.open("PUT",baseuri+uri);
      xhrPut.setRequestHeader('Authorization','Basic '+authstrPut);
      xhrPut.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
      xhrPut.setRequestHeader('Accept', 'application/json');
      xhrPut.send(JSON.stringify(params));

      //variables: baseuri, uri, authstrPut, params</code>
      </pre>
      <p>With regards.</p></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              jhaynie Jeff Haynie (Inactive)
              Reporter:
              martinlasak Martin Lasak
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration