I'm trying to use a cql query in an Ajax GET to get some search suggestions. So far it works for a single word (like below), and returns 5 suggestions as intended.
http://<myurl.com.au>/rest/api/content/search?cql=text~wifi&limit=5&type=page
However any spaces I add to the search end up double encoding the spaces as %2520 and cause the query to fail with the following error:
http://<myurl.com.au>/rest/api/content/search?cql=text~wifi%2520network&limit=5&type=page
"message":"Could not parse cql : text~wifi%20network"}
Is my syntax for the request wrong? How can I handle spaces/multiple words better? I'd be happy to share more of my code if its relevant.