Skip to content

Instantly share code, notes, and snippets.

@px-amaac
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save px-amaac/9998933 to your computer and use it in GitHub Desktop.
Save px-amaac/9998933 to your computer and use it in GitHub Desktop.
private void findMaid(String httpRequestExtension) {
PassRestClient.get(httpRequestExtension, null,
new JsonHttpResponseHandler() {
@Override
public void onSuccess(JSONObject response) {
new ParseMaid().execute(response);
}
});
}
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
public class PassRestClient {
private static final String BASE_URL = "http://appdomum.com/services/parkingpass_11.php";
private static AsyncHttpClient client = new AsyncHttpClient();
public static void get(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
client.get(getAbsoluteUrl(url), params, responseHandler);
}
public static void post(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
client.post(getAbsoluteUrl(url), params, responseHandler);
}
public static String getAbsoluteUrl(String relativeUrl) {
return BASE_URL + relativeUrl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment