I am using Volley:1.1.1 to connect to localhost in my android application
my code :
public static final String API_URL = "http://127.0.0.1:5365/api/Account/LoginUser?username=A_easy&password=123";
JsonObjectRequest request = new JsonObjectRequest(Request.Method.POST, API_URL, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i("APIRes", "response : " + response);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.i("APIRes", "error : " + error.getMessage());
}
});
RequestQueue queue = Volley.newRequestQueue(getApplicationContext());
queue.add(request);
The error I get is error:null
The Logcat is showing this
I/Choreographer: Skipped 170 frames! The application may be doing too much work on its main thread.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/APIRes: error : null
-It works on Postman
-I have tried GET method but the result is the same
-I have tried 10.0.2.2
and my IP address but the result is the same