View Single Post
Polaco's Avatar Polaco Polaco is offline 2008-11-11 #4 Old  
Last edited by Polaco : 2008-11-11 at 17:39.
I have seen this post:
[AS3] URLLoader data?

but I don't get it completely. What data format should I use if I don't know what it's comming?
Can I detect the dataFormat incoming using "instanceof" ? eg:
urlLoader.data instanceof ByteArray

How can I set the Loader to recieve any data? If I recieve gzipped data I have to decompress it using AS?

.. I have also seen on this page:
http://blog.dannypatterson.com/?p=133#more-133
the following piece of code:
ActionScript Code:
  1. ...
  2. var request:URLRequest = new URLRequest();
  3. request.url = “YOUR_SERVICE_ENDPOINT”;
  4. request.method = URLRequestMethod.POST;
  5. request.contentType = “text/xml; charset=utf-8″;
  6. request.requestHeaders.push(new URLRequestHeader(”SOAPAction”, “YOUR_SOAP_ACTION”));
  7. request.requestHeaders.push(new URLRequestHeader(”Accept-Encoding”, “gzip”));
  8.  
  9. var loader:URLLoader = new URLLoader();
  10. loader.dataFormat = URLLoaderDataFormat.BINARY;
  11. loader.addEventListener(Event.COMPLETE, onResult, false, 0, true);
  12. loader.load(request);
  13. ...

If I set
request.url = to my servlet url
and
Accept-Encoding to text
could this force the iis to not compress the data?

thanks again!

Polaco.
Reply With Quote