I would like to accept simple quotes into a string without crashing my curl request.
here my curl request :
curl -XGET "localhost:9200/test/all/_search?pretty" -d \'{"query":"'+question+'"}\'';
If question = 'It's OK'
.
I will have an error durong my request
Syntax error: Unterminated quoted string
For the moment I tried several solutions (like this one below), but none worked :
question = question.replace(/'/g, "\\'");
Have you got a solution to fix it ?