且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将单引号转义为双引号转换为单引号

更新时间:2022-12-12 09:14:28

如果您替换为'by unicode encoded'(这是\\\'),那么它的工作原理:

If you replace ' by unicode encoded ' (which is \u0027), then it works:

curl http://dumbdomain.com/solr/collection2/update/json -H 'Content-type:application/json' -d ' { "add": { "doc": { "uid": "79729", "text" : "I\u0027ve got your number"} } }'

奇怪,但值得了解!