I\'m trying to use org.apache.httpcomponents to consume a Rest API, which will post JSON format data to API.
org.apache.httpcomponents
I get this exception:
This can happen if you have a newline (or other control character) in a JSON string literal.
{"foo": "bar baz"}
If you are the one producing the data, replace actual newlines with escaped ones "\\n" when creating your string literals.
"\\n"
{"foo": "bar\nbaz"}