Skip to content
Advertisement

How to create query parameters in Javascript?

Is there any way to create the query parameters for doing a GET request in JavaScript?

Just like in Python you have urllib.urlencode(), which takes in a dictionary (or list of two tuples) and creates a string like 'var1=value1&var2=value2'.

Advertisement

Answer

Here you go:

JavaScript

Usage:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement