我刚打酱油去了,不好意思

curl -d中的json存在引号怎么处理?

Elasticsearch | 作者 smartfly2017 | 发布于2017年10月11日 | 阅读数:7411

curl -XGET '192.168.213.128:9200/my_index_1/_analyze?pretty' -H 'Content-Type: application/json' -d'
{
"field": "title",
"text": "I'm not happy about the foxes"
}
'
中I'm怎么转义呢?
已邀请:

smartfly2017

赞同来自: zhugw

已经解决,针对I'm问题需要进行转义,将其改写为I'\''m就可以完美执行啦

zhugw

赞同来自:

遇到同样的问题 总算解决了
 
curl -XPOST "http://localhost:9200/_sql?format=txt" -H 'Content-Type: application/json' -d'
{
"query": "SELECT hldId, comId, count(*) FROM shareholder where type = '\''自然人股东'\'' and hldId is not null GROUP BY hldId, comId order by count(*) desc limit 1"
}'

要回复问题请先登录注册