I just want to make data form post like from Postman, I have code like this
@PostMapping(value = "/current_location_all")
@ResponseBody
public JSONObject getCurrentLocationAll(Principal principal) throws Exception {
JSONArray list = new JSONArray();
JSONObject obj = new JSONObject();
JSONObject obj1 = new JSONObject();
String result = "";
String userName = "santoso215";
UserTBike user = userService.getUserByUsername(userName);
Whitelist wl = whitelistService.getBikeId(userName);
List<TBike> bike = tbikeService.getAllLocation(wl.getBikeId());
for (int i = 0; i < bike.size(); i++) {
obj1.put("bikeID",bike.get(i).getBikeId());
obj1.put("imei",bike.get(i).getBikeImei());
obj1.put("gpsTime",bike.get(i).getGpsLastUpdate());
obj1.put("lo",bike.get(i).getBikeLongitude());
obj1.put("la",bike.get(i).getBikeLatitude());
obj1.put("gps_status",bike.get(i).getBikeGpsStatus());
list.add(obj1);
}
obj.put("success", true);
obj.put("data", list);
return obj;
}
but in Postman I'm not use form data to hit post.
It's not fill value from postman
How can I post with fill the value form (form-data in Postman).