Created
October 27, 2021 09:36
-
-
Save nguyenit67/771ec9cc4b0566a205ca7627c4b26e46 to your computer and use it in GitHub Desktop.
Encode a Javascript Object into a string that I can pass via a GET Request
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
| const searchString = new URLSearchParams(object).toString(); | |
| https://stackoverflow.com/a/53171438/13835451 | |
| Only work for flat object, not nested ones |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment