I tried using Volley to get JSON response but it comes something wrong.
This is my Code.
private fun sendGet() {
val queue = Volley.newRequestQueue(this)
val url = "http://localhost/Book/all"
val stringRequest = JsonObjectRequest(Request.Method.GET, url, null,
{ response ->
// Display the first 500 characters of the response string.
text!!.text = response.toString()
},
{ error ->
text!!.text = error.toString() })
queue.add(stringRequest)
}
But it always requests
com.android. volley. NoConnectionError: java.io. IOException: Cleartext HTTP traffc to localhost not permitted
The server is built from IIS. Where can I change my Code?