Envio a requisição o servidor se comporta com deveria não da erro, mais do lado do response me gera o seguinte erro "com.android.volley.volleyerror java.lang.runtimeException: bad url." estou usando o Android studio , WebView e o Volley.
Classe MainActivity;
Map<String, String> postParam= new HashMap<>();
postParam.put("username", "admin");
postParam.put("password", "onblox");
CustonRequest jsObjRequest = new CustonRequest(
Request.Method.POST,
"http//:192.168.0.13:8088/onblox/login",
postParam,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Toast.makeText(MainActivity.this,response.toString(),Toast.LENGTH_LONG).show();
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(MainActivity.this,error.toString(),Toast.LENGTH_LONG).show();
}
});
rq.add(jsObjRequest);
Classe CustonRequest :
public class CustonRequest extends Request<JSONObject> {
private Response.Listener<JSONObject> response;
private Map<String,String> parm;
public CustonRequest(int method, String url, Map<String,String> parm, Response.Listener<JSONObject> response, Response.ErrorListener listener) {
super(method, url, listener);
this.response = response;
this.parm = parm;
}
public CustonRequest( String url, Map<String,String> parm, Response.Listener<JSONObject> response, Response.ErrorListener listener) {
super(Method.GET, url, listener);
this.response = response;
this.parm = parm;
}
public Map<String,String> getParm()throws AuthFailureError{
return parm;
}
@Override
protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) {
try {
String js = new String(response.data, HttpHeaderParser.parseCharset(response.headers));
return (Response.success(new JSONObject(js),HttpHeaderParser.parseCacheHeaders(response)));
}catch (UnsupportedEncodingException e){
e.printStackTrace();
}catch (JSONException e){
e.printStackTrace();
}
return null;
}
@Override
protected void deliverResponse(JSONObject response) {
this.response.onResponse(response);
}
}