I am using
curl --data-binary "content=abcdeöäüabcde" http://myserver.com/application/api -H "Content-Type: application/x-www-form-urlencoded; encoding=utf-8"
to POST form data to my web server.
On server side I want to decode the content:
@POST
@Path("/api")
@Consumes("application/x-www-form-urlencoded")
public void createNote(@FormParam("content") String content){
System.out.println(content);
}
The result is abcde???abcde
Does anybody know how I can tell this method to consume the form parameters as UTF-8?
It seems that cURL isn’t able to process UTF-8 encoded Strings in POST requests at all. Converting the string to
latin1fixed my problem.