Requesting pages and reading results with Flash

I have a Flash object hosted on foo.com. When I run it, I want it to send a HTTP request to foo.com, and retrieve the results along with HTTP headers.

How would one achieve this with Flash? (AS 3)

Answers


You would use URLLoader to send a URLRequest to foo.com. You can add headers by pushing new URLRequestHeader's onto the URLRequest.requestHeaders array. I'm not sure about reading the headers though. I think it's possible with sockets and AIR seems to have the httpResponseStatus event (not httpStatus like the Flash API) which

unlike the httpStatus event, the httpResponseStatus event is delivered before any response data. Also, the httpResponseStatus event includes values for the responseHeaders and responseURL properties (which are undefined for an httpStatus event. Note that the httpResponseStatus event (if any) will be sent before (and in addition to) any complete or error event.


Need Your Help

Bean validation which is disabled in JSF is re-enabled after submit

hibernate jpa jsf-2 bean-validation

Given: JSF2 Form with some input fields, including password field.

Postgres Unique Constraint on two columns: Integer and Boolean

postgresql constraints unique

I would like to find a way to store multiple addresses for one subject in my database, with only one default address per subject.