Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3254] Setting data in HTTPClient.send will force a POST connectionType

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-08T23:22:04.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterDhaya Benmessaoud
AssigneeIngo Muschenetz
Created2011-04-15T03:40:35.000+0000
Updated2017-06-08T23:22:04.000+0000

Description

Whenever I try to send data with an HTTPClient it forces the connectionType on POST, even if I set it on GET with HTTPClient.open("GET", url)

I figured out a temporary workaround for this thing, but it would be great if it could be fixed.

if (method == "GET" && data != null ) {
    if ( typeof(data) == 'object' ) {
        var pairs = [];
        for ( var key in data ) {
            if (data.hasOwnProperty(key) ) { pairs.push(key + "=" + data[key]); }
        }
        url += "?" + pairs.join('&');
    } else if ( typeof(data) == 'string' ) {
        url += "?" + data;
    }
    data = null;
}
var loader = Titanium.Network.createHTTPClient();
loader.open(method, url);
/* loader.onload ... */
loader.send(data);

Comments

  1. Lee Morris 2017-06-08

    Closing ticket as there has been no input for the last 6 years. Any problems, please file a new ticket.

JSON Source