Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting http 500 response body with flex

Tags:

apache-flex

I am using a HttpService object in flex to communicate with the server. I am using java in the server (tomcat), and once an exception occurs the fault event listener in the flex is called. I am passing data on the exception in the response body in a xml form.

The thing is the flex fault event does not read the data from the response. How can i read the response body?

like image 934
Noam Nevo Avatar asked Dec 01 '25 05:12

Noam Nevo


1 Answers

In my experience, you can't. Flex turns any 400-599 response codes into a generic IOError and only gives the status code. My understanding is that this is a browser-plugin limitation, but I'm not sure of the extent/reason.

The way we've gotten around it is that all 400-599's get wrapped as 200-OK with a response showing the details of the error. I've heard many argue that this means Flex/Flash can never truly be a RESTful client.

like image 193
Justin N Avatar answered Dec 03 '25 18:12

Justin N