How to urlencode a query string in Python?

705    Asked by arun_3288 in Python , Asked on Mar 3, 2021
Answered by Arun Singh

Simply make a word reference with your boundaries to be encoded in the urlencode function of urrlib module. e.g:

For python 2:

import urllib

d = {'a': 'b', 'c': 'd'};


For Python 3

import urllib

d = {'a': 'b', 'c': 'd'};


Your Answer


Parent Categories