-1

i am making webservice calling using volly my method is as below

 Map<String, String> MyData = new HashMap<String, String>();
        MyData.put(pam1, parm1value);


        JSONObject parameters = new JSONObject(MyData);
        System.out.println(parameters + " *** PRM");//this prints data
        JsonObjectRequest jsonRequest = new JsonObjectRequest(Request.Method.GET,
                "myurl",
                parameters, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                //TODO: handle success
                System.out.println(response+"***");

            }

        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                error.printStackTrace();
                //TODO: handle failure
            }
        });
        System.out.println("REQ "+jsonRequest+"");//not prints parms 
        Volley.newRequestQueue(ctx).add(jsonRequest);  

But, when running app i got

 [220] BasicNetwork.performRequest: Unexpected response code 500 for [my url]

I also tried with StringRequest with hashmap parms but same problem

Developer
  • 333
  • 2
  • 16

1 Answers1

0

Follow this steps while making volley request

Volley Request Step By Step

change method to GET from POST.