Skip to main content
Inspiring
October 8, 2011
Answered

HTTPService fail to send parameters

  • October 8, 2011
  • 1 reply
  • 700 views

Flash Builder 4.5

Flash Player 10.3

Windows 7 pro 64 bit

problem,

I'm sending an object as http parameters, but it never arrive to the web server.

help welcomed.

more info,

flash builder network monito shows that the http request include the parameters.

wireshark capture shows that there are no parameters in the http request.

source code

    <fx:Script>

        <![CDATA[

            import com.adobe.serialization.json.JSON;

            import com.adobe.serializers.json.JSONEncoder;   

            import mx.rpc.events.FaultEvent;

            import mx.rpc.events.ResultEvent;

            import mx.rpc.http.HTTPService;

            protected function button1_clickHandler(event:MouseEvent):void

            {

                var streamParams:Object = new Object;

                streamParams.title = "demostration";

                streamParams.quality = 1;               

                vidictionService.contentType="application/json";

                       

                vidictionService.send(streamParams);           

            }

           

            protected function httpResultHandler(evt:ResultEvent):void

            {

                trace("InitView.httpResultHandler()" + evt.result.toString());

                navigator.pushView(views.MobileLiveHomeView,{streamParams:evt.result});

            }

           

            protected function httpFaultHandler(evt:FaultEvent):void

            {

                trace("InitView.httpFaultHandler()" + evt.toString());           

            }       

        ]]>

    </fx:Script>

   

    <fx:Declarations>

        <s:HTTPService id="vidictionService"

                       url="http://192.168.2.104:9000/streams/save"

                       fault="httpFaultHandler(event)"

                       result="httpResultHandler(event)"

                       resultFormat="object"

                       showBusyCursor="true"/>

    </fx:Declarations>

   

    <s:Button bottom="10" label="Publish" click="button1_clickHandler(event)" horizontalCenter="0"/>

This topic has been closed for replies.
Correct answer oferkru

found the solution:

vidictionService.method = "POST";

               

vidictionService.send(JSON.encode(streamParams));

1 reply

oferkruAuthorCorrect answer
Inspiring
October 8, 2011

found the solution:

vidictionService.method = "POST";

               

vidictionService.send(JSON.encode(streamParams));