jsonjson-server

JSON server: & and |


Titles for query: ["title1", "title2", "title3 & title3]

Request for json server looks this way: ?title1 | title2 | title3&title3

And this works until order is changed: title3&title3|title1|title2

(this query ingore everything after ampersand symbol)

The question: is there way to say to json server, that ampersand is not a part of regular expression? And get objects for all three titles without changing order.


Solution

  • The answer is:

    If you want to use an ampersand as a value inside the query string of a url (and not as a delimiter for separating arguments), then you should use the URL-encoded value: %26