I'm having issues uploading a file via resttemplate client on linux
Here's what I have currently
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
MultiValueMap<String, Object> form = new LinkedMultiValueMap<>();
form.add("image", new FileSystemResource(imageFile));
HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(form, headers);
UploadResponse response = restTemplate.postForEntity(uploadUrl,httpEntity, UploadResponse.class).getBody();
Code works fine on windows but returns this error on linux:
I/O error on POST request for "https://baseurl/api/v1/upload": Illegal unquoted character ((CTRL-CHAR, code 13)): has to be escaped using backslash to be included in string value
at [Source: (StringReader); line: 1, column: 47]; nested exception is com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 13)): has to be escaped using backslash to be included in string value
Anyone has an idea what might be wrong?