I've had my fair share of exposure with python requests - so thought I'd chime in.
ParseResult(scheme='http', netloc='localhost:8080', path='/test/url', params='', query='with=params', fragment='')
scheme, host, port = get_host(url)
if scheme == 'https':
return HTTPSConnectionPool(host, port=port, **kw)
else:
return HTTPConnectionPool(host, port=port, **kw)
get_host -> parse_url()
Tracing through urllib3 finally gets to parse_url();
Url(scheme='http', auth=None, host='localhost', port=8080, path='/test/url', query='with=params', fragment=None)
So, lets look at path_url() instead;
>>> lol.request.path_url
'/api/v1/host/?name__regex=&format=json'
Performing a test connection shows;
fo...@test01.internal [~] > nc -p8000 -l
GET /api/v1/host/?name__regex=&format=json HTTP/1.1
Host: localhost:8000
Accept-Encoding: identity, deflate, compress, gzip
Accept: */*
User-Agent: python-requests/0.11.1
So, from what I can tell, python requests is functioning normally.
Personally, I'd say get wireshark running, or use the nc trick shown above, perform 1 request using curl and 1 using python requests, then compare the request headers.
Can't throw much more time at this, but hope the above helps
Cal