我从命令行运行curl命令(Windows上的Git Bash ),或者作为Bash脚本的一部分运行。
curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d "{\"testField\":\"ä\"}" https://someurl...
curl命令的主体有一个Umlaut。
服务器是在AWS弹性Bean秸秆容器中运行的,它返回以下错误:
JSON parse error: Invalid UTF-8 middle byte 0x22; nested exception is com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 middle byte 0x22\n at [Source: (PushbackInputStream); line: 1, column: 17]
导入到Postman中的同一个curl命令工作得很好,所以我认为这是一个卷曲问题,而不是服务器问题。
发布于 2018-05-02 20:07:46
尝试将字符ä
替换为其UTF8编码\u00e4
:
curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"testField":"u00e4"}' https://someurl..
https://unix.stackexchange.com/questions/441397
复制相似问题