There are 2 variables. How to make a request like site.com/String1/string2 ?

 StringRequest strReq = new StringRequest(Method.GET, site.com/, new Response.Listener<String>() { 

I tried to add a slash to the first variable, but it does not give anything.

 @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<String, String>(); params.put("String1", String1+"/"); params.put("String2", String2); return params; } 

    2 answers 2

    Instead of site.com/ you should have a String variable with an address. Here in it and add the necessary:

     String part1 = "part1"; String part2 = "part2"; String slesh = "/"; String url = "http://site.com" + slesh + part1 + slesh + part; StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>(){...}); 

      The question is not clear. For you to add down? If you just need to send a request with parameters, then

       @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<String, String>(); params.put("String1", String1); params.put("String2", String2); return params; } 

      This is quite enough, or you can try so 'site.com/path?param1=value1¶m2=value2'