New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use API with default urllib #297
Comments
It works for me with urllib, I haven't tried urllib2 |
This is an example of a HTTP request that returns a 500 error on my PyLoad installation:
Note that the error is not related to the dummy POST data. |
This code always worked for me: import json
import urllib
u = 'http://localhost:8000/api/login'
post_data = urllib.urlencode({'username': 'user', 'password': 'pwd'})
rep = urllib.urlopen(u, post_data).read()
SESSION_ID = json.loads(rep) |
Note that I I'm not looking for a solution, I can get it working by sending HTTP requests that accept a gzipped response. I just wanted to report this as an issue, in case it is one. If my error is reproducible on a standard PyLoad installation, I think it should be fixed. Otherwise, it might be an issue with the way my PyLoad has been packaged for Synology. |
We can't fix it in 0.4.9 because it is frozen, if 0.5 is affacted I'm sure @RaNaN will fix it. |
This ticket has been automatically marked as |
This ticket has been automatically closed. |
This ticket has been automatically locked since there has not been any recent activity after it was closed. |
Strangly, it works using requests:
It turns out that this is because urllib2 only sets this Accpet-Encoding header:
Things look better when I add gzip manually:
I should say that I am using pyload as packaged by http://spk.unzureichende.info/ for Synology, using 0.4.9-4.
The text was updated successfully, but these errors were encountered: