Actionscript - HTTP Request
Actionscript - HTTP Request
protected function button_clickHandler( event:MouseEvent ):void
{
//set up url
var username:String = "sterling_archer@ikanow.com";
var hashedpassword:String = "WZRHGrsBESr8wYFZ9sx0tPURuZgG2lmzyvWpwXPKz8U%3D"; //don't forget to URLEncode your arguments
var address:String = "http://infinite.ikanow.com/api/auth/login/" + username + "/" + hashedpassword;
//send request
var httpService:HTTPService = new HTTPService();
httpService.addEventListener( ResultEvent.RESULT, httpResultHandler );
httpService.addEventListener( FaultEvent.FAULT, httpFaultHandler );
httpService.url = address;
httpService.send();
}
protected function httpFaultHandler( event:FaultEvent ):void
{
Alert.show( "Http Request had an error: " + event.message );
}
protected function httpResultHandler( event:ResultEvent ):void
{
//print out response json
Alert.show( event.result.toString() );
}
, multiple selections available,