Last active
July 7, 2020 21:01
-
-
Save metabsd/63502e0b39f47514c123cb59c82f2989 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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