Hi, I am using an HTTPService to make a POST request to a PHP server - the issue I am having is that the POST data/params is not retrieved on the server... Below is my code in delegate file (I followed examples using 'crux'):

Beans.mxml

<crux:BeanProvider
        xmlns:fx="http://ns.adobe.com/mxml/2009";
        xmlns:crux="library://ns.apache.org/royale/crux"
        xmlns:mx="library://ns.apache.org/royale/mx"
        xmlns:model="model.*"
        xmlns:service="service.*"
        xmlns:controller="controller.*">
        
        <!-- services config -->
        <mx:HTTPService id="loginService" showBusyCursor="true"/>

LoginDelegate.as
package service
{
        import org.apache.royale.events.IEventDispatcher;
        import mx.rpc.AsyncToken;
        import mx.rpc.http.HTTPService;

        /**
         * @royalesupresspublicvarwarning
         */
        public class LoginDelegate
        {
                
                [Dispatcher]
                public var dispatcher:IEventDispatcher;
        
                [Inject('loginService')]
                public var loginService:HTTPService;
                
                public function LoginDelegate() {
                }
                
public function login(loginURL:String, params:Object):AsyncToken {
                        loginService.method = "POST";
loginService.url = loginURL + 'login_web'; // "login_URL" is for e.g. http://localhost/mySite/
                        
                        
return loginService.send(params); // "params" is an object as {user: xxx:, pwd: 123}
                }
        }
}

------------

On my PHP server both the "$_POST" and "file_get_contents('php://input')" returns blank...

Did I miss something on the HTTPService ? Or is there another way to pass data through POST request ?


Thanks & Regards

Joanne

Reply via email to