elasticsearch,Curl,elasticsearch" /> elasticsearch,Curl,elasticsearch" />

如何在curl中发送单引号和特殊字符

如何在curl中发送单引号和特殊字符,curl,elasticsearch,Curl,elasticsearch,我试着做一个卷曲击球,这是类似于: curl -XPOST 'http://localhost:9200/market/products/' -d '{ "description": \"If you and your husband or boyfriend like to wear things that match; and he wears frame model 189812 or 189832; or the Unisex frame models 187821 or 187

我试着做一个卷曲击球,这是类似于:

curl -XPOST 'http://localhost:9200/market/products/' -d '{
    "description": \"If you and your husband or boyfriend like to wear things that match; and he wears frame model 189812 or 189832; or the Unisex frame models 187821 or 187812; you've got to get this full-rim; round; medium-size; faux-wood; hypoallergenic acetate Women's eyeglasses frame. The male and female versions of these glasses are similar; although these are actually a little bigger than the male model. (We're talking about your guy; so don't start thinking about male models; unless he is one.) One version is brown; the other is purple; and the two of you will look adorable in your matching glasses. If you're single; you won't be for long (if that's your desire); because you'll look adorable in these glasses all by yourself!\"" }'
现在我的问题是描述字段中的特殊字符。谁能建议我该怎么办


谢谢

您需要将所有单引号翻一番,即youll而不是youll,并删除description字段中的第一个反斜杠,如下所示:

curl -XPOST 'http://localhost:9200/market/products/' -d '{    "description": "If you and your husband or boyfriend like to wear things that match; and he wears frame model 189812 or 189832; or the Unisex frame models 187821 or 187812; you''ve got to get this full-rim; round; medium-size; faux-wood; hypoallergenic acetate Women''s eyeglasses frame. The male and female versions of these glasses are similar; although these are actually a little bigger than the male model. (We''re talking about your guy; so don''t start thinking about male models; unless he is one.) One version is brown; the other is purple; and the two of you will look adorable in your matching glasses. If you''re single; you won''t be for long (if that''s your desire); because you''ll look adorable in these glasses all by yourself!\"" }'
                                                                             ^
                                                                             |
                                                           remove the backslash here