You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

処理の正常終了後HTTP要求が返された時に起動されます。
HttpRequestクラス (PRIM_WEB.HttpRequest) のメンバ

詳細


Completed イベントは、要求が正常に完了したときに発生します。
イベント・ルーチンは、要求されたメソッドが実行されるときに最もよくコード化されます。


この例では、 Weather API が非同期で実行され、データを JSON オブジェクトとして返します。
完了したイベントが発生すると、結果が処理されます。
Mthroutine Name(GetWeather) Access(*Private)
Define_Map For(*Input) Class(#prim_alph) Name(#Resource)
Define_Com Class(#PRIM_WEB.HttpRequest) Name(#Request)
#Request.URL := "http://api.openweathermap.org" + #Resource
#Request.ExecuteAsync
Evtroutine Handling(#Request.Completed)
If (#Request.Response *IsNot *null)
Case (#Request.Response.Status)
When (= 200)
#Com_owner.Update( #Request.Response.JSON.RootItem )
Otherwise
#Com_owner.UpdateForFailure( #Request )
Endcase
Endif
Endroutine
Endroutine

参照

すべてのコンポーネント クラス
テクニカルリファレンス

  • No labels