mercadolibre / python-sdk

MercadoLibre's Python SDK
131 stars 111 forks source link

ERROR 400 Backslash problem Replacement of / with %2F (SOLVED temporarily) #51

Open giskard333 opened 4 years ago

giskard333 commented 4 years ago

Hi !

I have a problem when i try:

resource=orders/search/recent?seller=$SELLER_ID

this: https://api.mercadolibre.com/orders/search/recent?seller=$SELLER_ID&access_token=$ACCESS_TOKEN became this: https://api.mercadolibre.com/orders%2Fsearch%2Frecent%3Fseller%3D$SELLER_ID and throw error 400 (backslash problem)

SOLVED editing in file: rest.py

url=url.replace("%2F",'/') url=url.replace("%3F",'?') url=url.replace("%3D",'=')

saludos

giskard333 commented 4 years ago

working around. File rest.py. Line 153.

my temporarily fix for this:

url=url.replace("%2F",'/') url=url.replace("%3F",'?') url=url.replace("%3D",'=')

url_temp=str(url).split('?')[0] #scan url for this specific query

if (url_temp=="https://api.mercadolibre.com/orders/search/recent"): url = url+'&' + urlencode(query_params) #using ampersand instead of question mark query_params={} #must get empty dict here, otherwise blowup

Now the query works fine.

smarley2 commented 4 years ago

Bad request 400. Same issue here. I used the requests directly to final link and solved. Will wait for the update of library,

gusarg81 commented 4 years ago

Then you will wait forever.... they never respond to any issue of this sdk...

WellingtonNico commented 3 years ago

hello guys, do some of you can help me? i cant even get access token, is there an easier way to get that? im trying with requests library, i dont have redirect_uri, just a simple app in my local computer, so i use a dummy redirect_uri, does this matter?