[flexcoders] Re: Sending a HEAD request
You could include a javascript function in the wrapper and call it from externalInterface.call. Something like... function UrlExists(url) { var http = new XMLHttpRequest(); http.open('HEAD', url, false); http.send(); return http.status!=404; } HTH Steve --- In flexcoders@yahoogroups.com, stephen_anson s...@... wrote: Hi, The server side dev team have asked if I can send a HEAD request to their home page in order to 'keep my flex app logged in' What is the best way of going about this. URLRequest will not allow the method as a HEAD as far as I can see. And URLLoader returns the html data, I basically need to send only Any ideas much appreciated thanks Steve
[flexcoders] Re: Sending a HEAD request
Thank you, Is there a way to do the same thing directly in actionscript? thanks Steve --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: You could include a javascript function in the wrapper and call it from externalInterface.call. Something like... function UrlExists(url) { var http = new XMLHttpRequest(); http.open('HEAD', url, false); http.send(); return http.status!=404; } HTH Steve --- In flexcoders@yahoogroups.com, stephen_anson s...@... wrote: Hi, The server side dev team have asked if I can send a HEAD request to their home page in order to 'keep my flex app logged in' What is the best way of going about this. URLRequest will not allow the method as a HEAD as far as I can see. And URLLoader returns the html data, I basically need to send only Any ideas much appreciated thanks Steve
[flexcoders] Re: Sending a HEAD request
You could probably use the URLLoader class (http://livedocs.adobe.com/flex/3/langref/flash/net/URLLoader.html) but then you would have to worry about the security sandbox. I have not done it but it looks doable. --- In flexcoders@yahoogroups.com, stephen_anson s...@... wrote: Thank you, Is there a way to do the same thing directly in actionscript? thanks Steve --- In flexcoders@yahoogroups.com, valdhor valdhorlists@ wrote: You could include a javascript function in the wrapper and call it from externalInterface.call. Something like... function UrlExists(url) { var http = new XMLHttpRequest(); http.open('HEAD', url, false); http.send(); return http.status!=404; } HTH Steve --- In flexcoders@yahoogroups.com, stephen_anson s...@... wrote: Hi, The server side dev team have asked if I can send a HEAD request to their home page in order to 'keep my flex app logged in' What is the best way of going about this. URLRequest will not allow the method as a HEAD as far as I can see. And URLLoader returns the html data, I basically need to send only Any ideas much appreciated thanks Steve
Re: [flexcoders] Re: Sending a HEAD request
Today on Twitter I heard about this library as3httpclient. Appears to support doing HEAD requests. See: http://code.google.com/p/as3httpclient/