Skip to content

Instantly share code, notes, and snippets.

@metabsd
Last active July 7, 2020 21:01
Show Gist options
  • Save metabsd/63502e0b39f47514c123cb59c82f2989 to your computer and use it in GitHub Desktop.
Save metabsd/63502e0b39f47514c123cb59c82f2989 to your computer and use it in GitHub Desktop.
Final result : q=project%3D%3D%22mm-uc-dev%22%20and%20sectag%3D%3D%22mm-app%22
Not encoded : {"q":"Project==\"mm-uc-dev\" and sectag==\"mm-app\""}
Input : [{'name': 'project', 'value': 'project1},{'name': 'sectag', 'value': 'sectag1'}]
q = name + "%3D%3D%22" + value + "%22%20" + "and" + (next item on the loop) "%20s" + name + "%3D%3D%22" + value (If the last one add) + "%22" at the end
Another example
Input : [{'name': 'project', 'value': 'project1},{'name': 'sectag', 'value': 'sectag1'},{'name': 'blah', 'value': 'blah1'}]
q = name + "%3D%3D%22" + value + "%22%20" + "and" + "%20" + name + "%3D%3D%22" + value + "%22%20" + "and" + "%20s" + name + "%3D%3D%22" + value + "%22"
Input : [{'name': 'project', 'value': 'project1}]
q = name + "%3D%3D%22" + value + "%22"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment