0

I am calling an API to evaluate a JMESPath expression passed as a query parameter. All goes well until I try to use logical AND. How do I encode the ampersand in the URL?

Using logical OR the URL looks like:

http://localhost:5000/query?query=members[?userSessions>=`0` ||  userSessions>=`0`].componentInfo[].code

The following query using logical AND does not work:

http://localhost:5000/query?query=members[?userSessions>=`0` &&  userSessions>=`0`].componentInfo[].code

The query is ok - I tested it at http://play.jmespath.org/

Spaceghost
  • 6,835
  • 3
  • 28
  • 42
  • What is the language you will use to process it? Here is an example of URL encoding for Python: https://stackoverflow.com/questions/5607551/how-to-urlencode-a-querystring-in-python. And so, your query should be: `query=members%5B%3FuserSessions%3E%3D%600%60%20%7C%7C%20%20userSessions%3E%3D%600%60%5D.componentInfo%5B%5D.code`. But you might want to URL decode it afterwards, so it is important to know your processing language. – β.εηοιτ.βε Dec 15 '22 at 07:58

0 Answers0