Issue 1:
I have a code that sends GET and POST requests every 10 seconds. But in case there is a delay, the POST requests line itself posts twice. I tried to debug this to the best of my ability and I couldn't but finalize that the library sends the requests twice, or it is something to do with TCP (but then the library should deal with it, right?

The code: # this is a general code to give an idea of my implementation

import requests

import time

while True:

source = requests.get(url)

result = source.json()

resp = request.post(another_url,json = result,headers)

time.sleep(10)

By default, this should be ok, but I don't understand why I get this :

If it is something to do with my code then please advise me, or otherwise I hope this bug can be fixed.

Thank you so much for this awesome library.

Issue 2:
Expected Result

Sending a request with request.get(url, data=data) should return a normal web response.

Actual Result

File "d:\VSWorkspace\MyWebClient.py", line 64, in query_api
response = requests.get(url, data=query)
File "C:\Program Files\Python36\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Program Files\Python36\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Program Files\Python36\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Program Files\Python36\lib\site-packages\requests\sessions.py", line 658, in send
r.content
File "C:\Program Files\Python36\lib\site-packages\requests\models.py", line 823, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "C:\Program Files\Python36\lib\site-packages\requests\models.py", line 745, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "C:\Program Files\Python36\lib\site-packages\urllib3\response.py", line 432, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "C:\Program Files\Python36\lib\site-packages\urllib3\response.py", line 601, in read_chunked
chunk = self._handle_chunk(amt)
File "C:\Program Files\Python36\lib\site-packages\urllib3\response.py", line 566, in _handle_chunk
returned_chunk = self._fp._safe_read(self.chunk_left)
File "C:\Program Files\Python36\lib\http\client.py", line 612, in _safe_read
chunk = self.fp.read(min(amt, MAXAMOUNT))
AttributeError: 'NoneType' object has no attribute 'read'

System Information

{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.4"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}

side note: my pylint in Visual Studio Code shows 8 errors in client.py: 6 constants that are undeclared, one global variable that's undeclared, and one index error that looks to be related to not declaring the variable type in the method definition. But I'm using python 3.6.4, so it could just be a compatibility issue in my pylint version.