-1

I want to send following JSON data of user login info to the server to verify and receive confirmation from server response.

My JSON format in which I want to send data is:

{"email":"test@gmail.com","password":"12345678","conf_password":"12345678"}

Note: I am using volley library and StringRequest to send data and receive data.

For now it is sending data in this format

email=test%40gmail.com and so on

Ajay
  • 7
  • 1

1 Answers1

0

if u have using Request method GET

use it

    JSONObject postData = new JSONObject();
       try {
        postData.put("name", name.getText().toString());
         ...
        // add more data and put to postdata

    } catch (JSONException e) {
        e.printStackTrace();
    }

and send postData to url for example www.abc.com?stingjson=postData

if u have using Requst Method Post

use it

before ; add this code

{
    @Override
    protected Map<String,String> getParams(){
      JSONObject postData = new JSONObject();
       try {
        postData.put("name", name.getText().toString());
         ...
        // add more data and put to postdata

    } catch (JSONException e) {
        e.printStackTrace();
    }
        Map<String,String> params = new HashMap<String, String>();
        params.put("YourProperty",postData );


        return params;
    }