mxml バージョンを使用していない場合、mx.rpc.http.HTTPService のコンストラクターには次の見出しがあります。
HTTPService(rootURL:String = null, destination:String = null)
パッケージ mx.rpc.http.mxml.HTTPService にある mxml バージョンを使用している場合、引数を持つコンストラクターを持つことはできません。
最初のケースについて話していると思います。
そのコンストラクターをオーバーライドすると、クラス定義が得られます。
public class XxxHttpService extends HTTPService
{
public function XxxHttpService(rootURL:String = null, destination:String = null) {
super(rootURL, destination);
...
this.headers = {HTTP_USER: "Wking", HTTP_PASSWORD: "Equeen"};
}
}
本サービスの構築
myService = new XxxHttpService("http://rooturl" , "myDestination")
myService.addEventListener(myHandler, ResultEvent.RESULT)
...
protected function myHandler(event:ResultEvent) {
...
}
あなたに与えるべきです:
HTTP_USER:Wking
HTTP_PASSWORD:Equeen
関数 send() を呼び出すときの http ヘッダー
myService.send();
よくわかりませんが、それらを GET 変数の POST として送信したい場合は、次のようにする必要があります。
myService.method = "POST";//or "GET"
myService.send({HTTP_USER: "Wking", HTTP_PASSWORD: "Equeen"});