3 ms·
It looks like this API in particular expects all requests to have a User-Agent header, and we don't set one by default. Setting any user agent appears to work;
by haikuginger 9y ago
It looks like this API in particular expects all requests to have a User-Agent header, and we don't set one by default. Setting any user agent appears to work; the issue isn't with the `Accept` header.
You can reproduce with curl with the following command:
curl -v 'https://oneom.tk/data/config' -H 'Accept: application/json' -H 'User-Agent:'
That'll nullify the default curl user agent and should produce the same results you were seeing with urllib3.
- UncleEntity 9y agoThat makes sense, I kind of figured they were doing something screwy. I'm guessing a blacklist on certain User-Agent settings. When I was messing with it I could get it to work with curl and (eventually) urllib but urllib3 was no bueno until I tried to reproduce the problem and just copied the header with the User-Agent field from the urllib code.