java - getting null in servlet . Sending data from android retrofit model -
servlet code :
response.setcontenttype("application/json"); gson gson = new gson(); requestobject requestobject = gson.fromjson(request.getreader(), requestobject.class); list<locationaddress> locationaddresslist = requestobject.getresponselocationaddresslist(); system.out.println( " list size after json parsing " +locationaddresslist.size());
android code :
@headers("content-type: application/json") @post("/rt-tracking/requestresponse") call<list<latlng>> getfeed(@body requestobject body );
call in service :
call<list<latlng>> call = locationinterface.getfeed(new requestobject(responselocationaddresses)); call.enqueue(new callback<list<latlng>>() { @override public void onresponse(call<list<latlng>> call, retrofit2.response<list<latlng>> response) { if (response.body() != null) { list<latlng> latlnglist = response.body(); ( latlng latlng : latlnglist) {
how parse json data @ server end using servlet.
Comments
Post a Comment