• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1136
  • Last Modified:

flex-fetch html code using httpservice post

I want to fetch html source code returned from google/or any other page.
Below is the sample code. the code should print the html source code in the textarea.

let me know where should I do changes to html source code?
do I need to change below by any other code?
 text="{userRequest.lastResult}"
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns="*" creationComplete="send_data()">
    <mx:Script>
        <![CDATA[
            private function send_data():void {
                userRequest.send();
            }
        ]]>
    </mx:Script>
 
    <mx:HTTPService id="userRequest" url="http://www.google.com/" useProxy="false" method="POST">
        <mx:request xmlns="">
            <q>monkey</q>
        </mx:request>
    </mx:HTTPService>
    <mx:TextArea x="10" y="31" width="403" height="174" id="txtarea" text="{userRequest.lastResult}"/>
</mx:Application>

Open in new window

0
SimonHowald
Asked:
SimonHowald
1 Solution
 
-null-Commented:
Hi

Unless google implement an open crossdomain.xml file, httpservice will not download data from google as the domain is different to the one the application is hosted on.  If this is the case, you need to implement a script on your website that gets the data for you and returns it.

-null-
0
 
SimonHowaldAuthor Commented:
Thanks for letting me know... I hope php + curl lib would be sufficient to use the same logic in server-side.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now