Skip to content

Instantly share code, notes, and snippets.

@kyle-go
Created September 8, 2022 07:44
Show Gist options
  • Save kyle-go/f085d1e5826179f969f825d7a3cd0670 to your computer and use it in GitHub Desktop.
Save kyle-go/f085d1e5826179f969f825d7a3cd0670 to your computer and use it in GitHub Desktop.
URL param encode
// rfc3986
// https://datatracker.ietf.org/doc/html/rfc3986#section-1.1
const queryParams = { param1: '@*/+~!@#$&*()=:/,;?+\'~!*()', param2: 'value2-_.!~*\'()' }
const queryString = new URLSearchParams(queryParams).toString()
console.log(queryString)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment