How to escape single quotes into double quotes into single quotes

后端 未结 4 1584
误落风尘
误落风尘 2020-12-03 02:52

Here is an example of command line that fit this description :

curl  http://dumbdomain.com/solr/collection2/update/json -H
\'Content-type:applic         


        
4条回答
  •  执笔经年
    2020-12-03 03:12

    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"} } }'
    

    Strange, but worth to know!

提交回复
热议问题