Note : For the bad request we are getting below error at the backend
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value
the backend already told you what is wrong: “illegal unquoted character (CTRL-CHAR, code 10)”. code 10 is a line feed. so the value katalon put into the body has a newline inside it, the hard coded one does not.
usual sources: the default value in the variables tab was pasted with a trailing enter, the value comes from an excel or csv cell with a line break, or it was built with a groovy triple quote string. quick check, in the verification tab of the request:
inspect() shows the \n explicitly. then fix it at the source, or strip it when you pass the variable, e.g. WS.sendRequest(findTestObject('API/PutThing', [id: myId.trim()])). if the value legitimately has line breaks (an address, a note), the json needs it escaped as \n, so pass it through JsonOutput.toJson(value) and drop the quotes around ${var} in the body.