Refine search
RequestParams params = new RequestParams(); params.put("notes", "Test api support"); client.post(restApiUrl, params, responseHandler);
AsyncHttpClient client = new AsyncHttpClient(); RequestParams params = new RequestParams(); params.put("email", "u"); params.put("password", "pass"); client.post("http://host?method=signIn", params, new AsyncHttpResponseHandler() { @Override public void onSuccess(String response) { // handle response here } });
AsyncHttpClient client = new AsyncHttpClient(); RequestParams params = new RequestParams(); params.put("q", "google"); client.post("http://google.com", params, new AsyncHttpResponseHandler(){ public void onSuccess(String arg0) { Log.d("TAG", "Success"); }; public void onFailure(Throwable arg0, String arg1) { Log.d("TAG", "Failure"); }; });
RequestParam params = new RequestParams(); params.put("key1", "value1"); params.put("key2", "value2"); File imgFile = new File(filePath); try { params.put("file",imgFile); } catch(FileNotFoundException e) {} AsyncHttpClient image = new AsyncHttpClient(); image.post(uploadURL, params, new AsyncHttpResponseHandler(){});
AsyncHttpClient myClient = new AsyncHttpClient(); myClient.get(URL, null); myClient.setCookieStore(myCookieStore); myClient.setCookieStore(myCookieStore); String username = ""; String password = ""; RequestParams params1 = new RequestParams(); params1.put("username", username); params1.put("password", password); pd = ProgressDialog.show(this, "", "Signing In..."); myClient.post(URL, params1,
RequestParams params = new RequestParams(); params.put("request", "mRequest"); params.put("outlet_id", "mOutletID"); AsyncHttpClient client = new AsyncHttpClient(); client.get("URL", params, new AsyncHttpResponseHandler() { @Override public void onFailure(Throwable arg0, String arg1) { // Handle the error } @Override public void onSuccess(String arg0) { // Do stuff with the result } });
RequestParams params= new RequestParams(); //params.put("file", new File(filePath)); params.put("file", new File(filePath), contentType); AsyncHttpClient client = new AsyncHttpClient(); //client.post(url, params, listener); client.put(url, params, listener);
AsyncHttpClient client = new AsyncHttpClient(); RequestParams params = new RequestParams(); params.put("key", "value");
private static final String TAG = "loopj"; private static AsyncHttpClient client = new AsyncHttpClient(); private final PersistentCookieStore myCookieStore; client.setCookieStore(myCookieStore); client.addHeader("Content-type", "application/json"); RequestParams params = new RequestParams(); params.put("username", username); params.put("password", password); client.post(uri + "/endpoint/user/login", params, new JsonHttpResponseHandler() { @Override
private void captchaLoad() { AsyncHttpClient myClient = new AsyncHttpClient(); PersistentCookieStore myCookieStore = new PersistentCookieStore(context); myClient.setCookieStore(myCookieStore); RequestParams params = new RequestParams(); myClient.post("http://www.extremetech.com/wp-content/uploads/2011/08/amd-logo-106x59.jpg", params, new AsyncHttpResponseHandler() { @Override public void onStart() { } @Override public void onSuccess(String response) { Log.i("EOH",response); ByteArrayInputStream bis = null; try { bis = new ByteArrayInputStream(response.getBytes("UTF8")); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } Bitmap bm=BitmapFactory.decodeStream(bis); ImageView imgView = (ImageView)findViewById(R.id.imageView2); imgView.setImageBitmap(bm); } @Override public void onFailure(Throwable e) { } }); }
final RequestParams requestParams = new RequestParams(); requestParams.add("Event[user_id]", user_id); requestParams.add("Event[city]", city); Log.d("imgPath", "img path = " + img); File file = new File(img); requestParams.put("Event[img]" , file); requestParams.add("Event[img]" , imgName); } catch (FileNotFoundException e) { e.printStackTrace(); AsyncHttpClient client = new AsyncHttpClient();
AsyncHttpClient client = new AsyncHttpClient(); AsyncHttpResponseHandler asyncHttpResponseHandler = new AsyncHttpResponseHandler() { RequestParams requestParams = new RequestParams(); requestParams.put("grant_type", "client_credentials"); AsyncHttpClient httpClient = new AsyncHttpClient(); httpClient.addHeader("Authorization", "Basic " + Base64.encodeToString((CONSUMER_KEY + ":" + CONSUMER_SECRET).getBytes(), Base64.NO_WRAP)); httpClient.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); responce); Log.e("", "token_type " + jsonObject.getString("token_type") + " access_token " + jsonObject.getString("access_token")); client.addHeader("Authorization", jsonObject.getString("token_type") + " " + jsonObject.getString("access_token")); client.get(url, asyncHttpResponseHandler); } catch (JSONException e) {
RequestParams params = new RequestParams(); params.put("dataArray", data.toString()); exportToWebService(params); AsyncHttpClient client = new AsyncHttpClient(); String url = "CHANGE URL HERE"; client.get(url, params, new AsyncHttpResponseHandler() {
RequestParams params = new RequestParams(); try { params.put("photo", FragmentPhotoCrop.croppedFile, "image/jpeg"); // croppedFile is a FIle params.setUseJsonStreamer(false); } catch (FileNotFoundException e) { } asyncHttpClient.put(getActivity(), url, params, new AsyncHttpResponseHandler() { .. //enter code here }
final RequestParams params = new RequestParams(); //create the hashmap with the parameters for Strings params.add("spot[title]", mtitle); params.add("spot[address]", maddress); params.add("spot[country]", mcountry); params.add("spot[shot_level]", "easy"); params.add("spot[photos_attributes][0][description]", mdescription); params.add("spot[latitude]", googlelat); params.add("spot[longitude]", googlelng); try { params.put("spot[photos_attributes][0][ref]", new File(sglimagepath)); } catch (FileNotFoundException e) { e.printStackTrace(); }
RequestParams params = new RequestParams(); for (String val : array) { params.add("descr_array[]", val); }
RequestParams rp = new RequestParams(); rp.add("username", "aaa"); rp.add("password", "aaa@123"); HttpUtils.post(AppConstant.URL_FEED, rp, new JsonHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { // If the response is JSONObject instead of expected JSONArray Log.d("asd", "---------------- this is response : " + response); try { JSONObject serverResp = new JSONObject(response.toString()); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void onSuccess(int statusCode, Header[] headers, JSONArray timeline) { // Pull out the first event on the public timeline } }); }
AsyncHttpClient client = new AsyncHttpClient(); RequestParams params = new RequestParams(); params.put("username",username); params.put("password",pass); client.post("http://www.example.com/", params, new AsyncHttpResponseHandler() { @Override public void onSuccess(String response) { //parse data with Jsoup } });
params = new RequestParams(); params.put("first_name", firstName); params.put("last_name", lastName); client = new AsyncHttpClient(); client.post("xxx.com/createCustomer.php", params, new TextHttpResponseHandler() { @Override public void onFailure(int i, Header[] headers, String s, Throwable throwable) { } @Override public void onSuccess(int i, Header[] headers, String s) {} );
// Create AsycHttpClient object AsyncHttpClient client = new AsyncHttpClient(); // Http Request Params Object RequestParams params = new RequestParams(); params.put("app_pkg", getPackageName().toString()); client.post("www.myapiKeysHolder.com", params, new AsyncHttpResponseHandler() { @Override public void onSuccess(String response) { String api=response; //Api give your Api Key updateSQLite("api_key",api); } });