0 Replies Latest reply on Dec 18, 2010 6:38 AM by MacLeod7222

    Passing header params from HttpService to REST webService Question


      I have a HTTPService that calls a REST webService. The webService expects a couple header params and I'm not sure if I'm passing them correctly. The code snippet below shows how I'm setting the header params. I'm also attaching my crossdomain.xml file. Can someone tell me if I'm setting the header params correctly?








      <mx:HTTPService id="service" url="https://someURL"
             method="POST" resultFormat="text" result="onResult(event)" fault="onFault(event)">     


      Function that sets header params


      private function setRequestHeader():void {                              
          service.headers["Authorization"] = "VIP " + myKey;
          service.headers["Content-Type"] = "application/json";


      CrossDomain.xml file


      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE cross-domain-policy SYSTEM
          <site-control permitted-cross-domain-policies="master-only"/>
          <allow-access-from domain="*"/>
          <allow-http-request-headers-from domain="*" headers="Authorization, Content-Type"/>