Take the 2-minute tour ×

I have a Adobe Flex web application that we are converting to an Adobe AIR application. On the server side, I have a servlet that only accepts a HTTP POST request. We use navigateToUrl() to open a webpage with the result of that POST request. In the web application, this works perfectly (a new tab is opened with the result of the request), but it does not work from the Adobe AIR client, using the exact same code. The HTTP POST gets converted into a HTTP GET which is not accepted by the servlet. The web browser shows:

HTTP Status 405 - Request method 'GET' not supported.

This is how the request is made:

var request:URLRequest = new URLRequest();
request.method = URLRequestMethod.POST;
request.url = presentationModel.exportURL;

(The exportURL variable is a String which looks like http://ipaddress:8080/myapp/export/eventhistory1339595975131.html)

I checked this forum post but the solution given there (replacing a const that points to a String with the string itself) does not make sense, and did not work when I tried it.

I also looked at this question, but there is no real answer there. The comment indicates that the user added a trailing slash to his URL to make it work, but that does not work in my case, since the url is of the form: http://ipaddress:8080/myapp/export/eventhistory1339595975131.html

I am using Adobe Air 3.3 and Flex SDK 4.5

share|improve this question
When you say it doesn't work; can you elaborate? What doesn't work? do you get an error? Do you get unexpected behavior? –  JeffryHouser Jun 13 '12 at 14:37
What exactly isn't working? Do you get any error messages? –  RIAstar Jun 13 '12 at 14:38
@www.Flextras.com I guess we hit enter at the same time ;) –  RIAstar Jun 13 '12 at 14:39
I have updated the question to be more clear. The problem is that AIR turns the POST into a GET. –  Wim Deblauwe Jun 14 '12 at 6:34

1 Answer 1

up vote 0 down vote accepted

Looking at the documentation for the navigateToURL method it appears to translate POST requests to GET


request:URLRequest — A URLRequest object that specifies the URL to navigate to. For content running in Adobe AIR, when using the navigateToURL() function, the runtime treats a URLRequest that uses the POST method (one that has its method property set to URLRequestMethod.POST) as using the GET method.

Perhaps use a URLLoader instead?

share|improve this answer
Thx. Totally missed that in the docs. I hope Adobe fixes that, I really don't understand why they have done this. Moreover, since if you use FileReference.download(Request, String) it does honer the POST setting in your request object! So they can support it if they want. –  Wim Deblauwe Jun 14 '12 at 14:32

Your Answer


