Titanium JIRA Archive
Appcelerator Community (AC)

[AC-971] tisdk 3.4.0.GA, ios, http post string error

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionInvalid
Resolution Date2015-09-28T15:43:49.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsHTTP, IOS, POST, TCSupportTriage
Reporter商汝麒
AssigneeShak Hossain
Created2014-10-08T07:01:21.000+0000
Updated2016-03-08T07:37:17.000+0000

Description

when use http post, there's always a ':' appended to data sent if the data is a string {quote} h = Ti.Network.createHTTPClient({ cache: false }); h.open("POST", "http://some_url.com"); h.send( '{"data":[], "data2":{}}' ); {quote} the request sent is intercepted by http proxy server, to capture the photo attached.

Attachments

FileDateSize
post_bug.tiff2014-10-08T07:01:21.000+00008600

Comments

  1. Motiur Rahman 2015-01-22

    Hello, It's not a bug, perhaps related to code formatting. It work's if we set something like this. Check [HTTPClient document](http://docs.appcelerator.com/platform/latest/#!/guide/HTTPClient_and_the_Request_Lifecycle) also. *Testing Environment:* Command-Line Interface, version 4.1.2, Ti SDK: 4.1.0.GA, Platform: Android,iOS Studio Version: 4.1.1 *Test Code*
       var xhr = Ti.Network.createHTTPClient();
       xhr.onload = function(e) {
       	//handle response, which at minimum will be an HTTP status code
       	Ti.API.info(this.responseText);
       };
       xhr.open('POST', 'http://some_url.com');
       
       xhr.send({
       	"data" : "[]",
       	"data2" : "{}"
       });
       
    Initiated of
       h.send('{"data":[], "data2":{}}');
       
       
        <?php echo $_POST["data"]; ?>
       <?php echo $_POST["data2"]; ?>
       
       
       []{}
       
    Thanks.

JSON Source