I use this code to get values from an HTTP request:
@PostMapping(consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, value = "/v1/notification")
public ResponseEntity<String> handleNotifications(@RequestBody MultiValueMap<String, Object> keyValuePairs) {
LOGGER.debug("handleFormMessage");
LOGGER.debug("keyValuePairs: {}", keyValuePairs);
String unique_id = String.valueOf(keyValuePairs.get("unique_id"));
System.out.println("!!!!!!!!!!!!!! ! unique_id " + unique_id);
}
But I get this value: !!!!!!!!!!!!!! ! unique_id [24q376c3ts2kh3o3220rry322dfe2k7y]
.
Is there a way to remove []
from the String without the classical String result = str.substring(0, index) + str.substring(index+1);
?
Is there a way to get the values?
I use this to post the values: