Created
August 1, 2018 03:06
-
-
Save haigopi/19b9bfde7bf0fe165a328c612a2655e7 to your computer and use it in GitHub Desktop.
Example of HTTP exchange inside action script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package allibilliHTTP | |
{ | |
import mx.rpc.events.ResultEvent; | |
import mx.rpc.http.HTTPService; | |
public class HttpUtil | |
{ | |
public var http:HTTPService=new HTTPService(); | |
//private static var serverURL:String="http://localhost:8080/AlliBilli/"; | |
private static var serverURL:String="http://services.allibilli.com/xml/"; | |
public function HttpUtil() | |
{ | |
} | |
public function sendRequest(URL:String, handler:Function):void | |
{ | |
http.url=serverURL + URL; | |
http.resultFormat="e4x"; | |
http.method="POST"; | |
trace(http.url); | |
http.addEventListener(ResultEvent.RESULT, handler); | |
http.send(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment