I'm trying to send data from my android app to my .NET core Web API on localhost.
The following is the error I get:
com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
The following is the code for post request on Android Studio using volley.
submitBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RequestQueue requestQueue = Volley.newRequestQueue(ManualHubActivity.this);
// 2 Create a post request
String url = "https://10.103.79.15:44371/continous/Add-Json";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
@Override
public void onResponse(String s) {
editValue.setText(s);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
editValue.setText("request was aborted" + volleyError);
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> map = new HashMap<String, String>();
map.put("UserID","205");
map.put("Value","205");
map.put("ReadtingType","205");
return map;
}
};
// 3 take post Request added to queue
requestQueue.add(stringRequest);
}
});
}