Back to project page android-mvc-framework.
The source code is released under:
Apache License
If you think the Android project android-mvc-framework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.android_mvc.sample_project.domain; //from w w w .j av a2 s . c o m import com.android_mvc.sample_project.activities.func_net.HttpNetActivity; import com.android_mvc.framework.controller.action.ActionResult; import com.android_mvc.framework.controller.action.BaseAction; import com.android_mvc.framework.controller.validation.ActivityParams; import com.android_mvc.framework.net.HttpPostRequest; import com.android_mvc.framework.net.HttpPostResponse; /** * ??????????BL? * @author id:language_and_engineering * */ public class HttpNetAction extends BaseAction { private HttpNetActivity activity; public HttpNetAction(HttpNetActivity activity) { this.activity = activity; } // BL?? @Override public ActionResult exec() { ActivityParams params = activity.toParams(); // ?????????URL????? String url = (String)params.getValue("http_url"); // HTTP???????????? HttpPostResponse response = new HttpPostRequest() .target(url) .addParam("key1", "value1") // POST??????????????? .getResponse() ; // ????????????? String routeId; if( response.isSuccess() ) { routeId = "success"; } else { routeId = "failed"; } // ?????????? return new HttpNetActionResult() .setRouteId( routeId ) .add("http_response", response) ; } // ??????????? static class HttpNetActionResult extends ActionResult { private static final long serialVersionUID = 1L; } }