-2

I have a server to which I need to send a request and get a response. I am using volley and this is what I have done so far

JSONObject request=new JSONObject();
try {
    request.put("ticket_id", ticket_id);
    request.put("start", start);
    request.put("extra", extra);
    request.put("care_category", care_category);
    request.put("k_means", "10");
    request.put("vendor", vendor);
    request.put("earlier_enteries", earlier_enteries);
} catch (JSONException e) {
    e.printStackTrace();
}

The response would be something like :

{"calculation":5.4444"}

How should I rend my request and or if there is any better way to do so ?

M at
  • 1,020
  • 1
  • 12
  • 26
eo1
  • 1
  • 2

1 Answers1

0

You have to use HTTPs requests (GET and POST). Retrofit and Gson will get it done.

There's a lot of tutorials and examples about it. See Retrofit Android Example HTTP GET Request