Volley

compile 'com.android.volley:volley:1.0.0'
【GET】

String jsonUrl="xxxxxx";

public void getVolley(){
    StringRequest stringRequest=new StringRequest(Request.Method.GET, jsonUrl, new Response.Listener<String>() {

        @Override
        public void onResponse(String response) {
         
            //execute code

        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {

            //Error

        }
    });
    RequestQueue requestQueue= Volley.newRequestQueue(this);
    requestQueue.add(stringRequest);
}
【POST】
String jsonUrl="xxxxxx";

public void postVolley(){
    StringRequest stringRequest=new StringRequest(Request.Method.POST, jsonUrl, new Response.Listener<String>() {

        @Override
        public void onResponse(String response) {
          
            //execute code

        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
           
            //Error

        }
    }){
        @Override
        protected Map<String, String> getParams() throws AuthFailureError {
            Map<String,String> params=new HashMap<>();
            params.put("APIKey","8m1p4h0rIdl8QoswswMSPu8MOWNifgAmU4vXOifrE3UX"); 
            params.put("LoginKey","GIYF6MJRGAYDANQ=");
            return params;
        }
    };
    RequestQueue requestQueue= Volley.newRequestQueue(this);
    requestQueue.add(stringRequest);
}