[AC-2447] POST Request does not send Parameter

GitHub Issuen/a
ResolutionCannot Reproduce
Resolution Date2014-01-20T07:54:16.000+0000
Affected Version/sn/a
Fix Version/sn/a
ReporterJohannes Weber
AssigneeShak Hossain


Steps to Reproduce

Hi, I have problems to send parameter via POST HTTPRequest. The url is called but no parameter are send ;-/ The posttestserver answers every time: No Post Params. Empty post body. Here my configuration: Titanium Studio, build: and my source code snipplet: var loginReq = Titanium.Network.createHTTPClient(); function doClick(e) { if ($.username.value != '' && $.password.value != '') { loginReq.open('POST','http://posttestserver.com/post.php'); var params = { username: $.username.value, password: Ti.Utils.md5HexDigest($.password.value) }; loginReq.send(params); } Can anyone help me? If you need more information, please contact me.

Actual Result

The posttestserver answers every time: No Post Params. Empty post body.

Expected Result

The posttestserver answers every time: No Post Params. Empty post body.


  1. Mostafizur Rahman 2013-12-28 Hello, I tested this issue with test code bellow. I can’t reproduce this issue in latest TiSDK 3.2GA. Please check my test code and let me know its working or not. If you have a different test case, please post a complete sample here.

    Test Environment:

    MAC OS X 10.8.5 TI SDK 3.2.0.GA Ti CLI 3.2.0 Alloy 1.3.0 IOS Simulator 7.0.3

    Test Code

       	<Window id="todoWin" title="Todo" platform="android,ios">
       		<Button id="button" onClick="postData">
       function postData() {
       	var xhr = Ti.Network.createHTTPClient({
       		onload : function() {
       			Ti.API.info("STATUS: " + this.status);
       			alert("TEXT:   " + this.responseText);
       			//json = JSON.parse(this.responseText);
       		onerror : function(e) {
       			Ti.API.info("STATUS: " + this.status);
       			Ti.API.info("TEXT:   " + this.responseText);
       			Ti.API.info("ERROR:  " + e.error);
       		timeout : 50000
       	var data = {
       		username : 'username',
       		password : 'password'
       	alert('data' + JSON.stringify(data));
       	xhr.open('POST', encodeURI('http://localhost/AppCTest/api.php'));
       	xhr.setRequestHeader('Content-Type', 'application/json');
    Server Side code
        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
               $params = file_get_contents('php://input');
               $params = json_decode(str_replace('\"', '"', $params));
                 echo json_encode($params);
           } else {
               echo json_encode((object) array('error' => 'invalid verb'));

    Step to Test

    Create alloy mobile apps

    Update my code in index.xml and index.js file and also server side code

    Click on post button its return post data from server

  2. Ritu Agrawal 2014-01-08 [~appcelerator@webdt.de] Please let us know if the provided test case helps solve your problem.
  3. Shak Hossain 2014-01-20 Marking this resolved since we can't reproduce the issue and the reporter has not provided us with any additional updates.

JSON Source