Reputation: 351
I use prepare() from Request to prepare the url before sending my request. But the value returned by the function is not correct. Like you can see this for the parameters codif= I send a list of values, and the result must be codif=7,110 but requests return me this codif%3D=7%2C110 and in fact is not work.
Do you have any idea to solve this?
from requests import Request
dict_data = {
'note':['716'],
'codif':[7, 110]}
request_parameters = {
'note=' : dict_data['note'],
'codif=' : ','.join([str(i) for i in dict_data['codif']]),
}
p = Request('GET', "https://test.intranert.com/api/light?", params=request_parameters).prepare()
p.url
Output : 'https://test.intranert.com/api/light?note%3D=716&codif%3D=7%2C110'
Expectation : 'https://test.intranert.com/api/light?note=716&codif=7,110'
Thank you,
Upvotes: 0
Views: 650