kopia lustrzana https://github.com/micropython/micropython-lib
urequests: Explicitly add "Connection: close" to request headers.
Even though we use HTTP 1.0, where closing connection after sending response should be the default, some servers ignore this requirement and keep the connection open. So, explicitly send corresponding header to get the expected behavior.pull/502/head
rodzic
5854ae1286
commit
d978e246d5
|
@ -81,7 +81,7 @@ def request(method, url, data=None, json=None, headers={}, stream=None, parse_he
|
|||
s.write(b"Content-Type: application/json\r\n")
|
||||
if data:
|
||||
s.write(b"Content-Length: %d\r\n" % len(data))
|
||||
s.write(b"\r\n")
|
||||
s.write(b"Connection: close\r\n\r\n")
|
||||
if data:
|
||||
s.write(data)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue