The following mxml file attempts to connect to BaseCamp to retrieve a list of Projects. The problem is how to specify the basic authorization. I notice that setCredentials() does not work with direct http connections (no proxying).
Any other ideas? (The username and passwords are all valid - I created a new basecamp project for this testing). <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:VBox width="100%" height="100%" horizontalAlign="center" verticalAlign="middle"> <mx:Panel> <mx:Form> <!-- <mx:FormItem label="Username:"> <mx:TextInput id="txtUsername"/> </mx:FormItem> <mx:FormItem label="Password:"> <mx:TextInput id="txtPassword" displayAsPassword="true"/> </mx:FormItem> <mx:FormItem label="Path:"> <mx:TextInput id="txtPath"/> </mx:FormItem> --> <mx:FormItem> <mx:Button label="Login" click="getProjects()"/> </mx:FormItem> </mx:Form> <mx:TextArea width="100%" height="100" id="txtResults"/> </mx:Panel> </mx:VBox> <mx:HTTPService concurrency="single" contentType="application/xml" resultFormat="xml" makeObjectsBindable="true" id="feedRequest" url="http://flexexample.projectpath.com/project/list" method="POST" useProxy="false" fault="handleFault(event)" result="handleResult(event)"> <mx:request> <request> </request> </mx:request> </mx:HTTPService> <mx:Script> <![CDATA[ import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; public function getProjects() : void { // the username is flexexample // the password is flexexample feedRequest.headers = { Authorization: "Basic ZmxleGV4YW1wbGU6ZmxleGV4YW1wbGU=", Accept: "application/xml" }; feedRequest.send(); } public function handleFault(event:FaultEvent) : void { txtResults.text = "FAULT: " + event.toString(); } public function handleResult(event:ResultEvent) : void { txtResults.text = "RESULT: " + event.result.toString(); } ]]> </mx:Script> </mx:Application>

