connection header is not used as session headers are not used
See original GitHub issueHere there should be an extra line headers.update(self.session.headers)
.
But for kucoin, I get Invalid KC-API-SIGN
after changing this.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Connection - HTTP - MDN Web Docs
The Connection general header controls whether the network connection stays open after the current transaction finishes.
Read more >Advanced Client Usage — aiohttp 3.8.3 documentation
Create the session first, use the instance for performing HTTP requests and initiating WebSocket connections. The session contains a cookie storage and ...
Read more >Sessions apparently corrupting header values on subsequent ...
The weird thing, though, is that accessing https://httpbin.org/headers with a session, it tells me the request was sent with Connection: close ...
Read more >Chapter 6. Handling HTTP Requests - STON Edge Server
For an HTTP request like this, a “Connection: Close” response will be returned regardless of the virtual host settings. The Keep-Alive header will...
Read more >Python-Requests close http connection - Stack Overflow
Lets say i create a session using "with" in one function and return the session. Use the session in all my tests. How...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah, ok, now I get it, will check that and will be back to you asap. Thx!
Now I didn’t get the error which I got for fetch_order_book.
Headers: Before:
fetch Request: kucoin GET https://openapi-v2.kucoin.com/api/v3/market/orderbook/level2?symbol=BTC-USDT RequestHeaders: {'User-Agent': 'python-requests/2.27.1', 'Accept-Encoding': 'gzip, deflate'} RequestBody: None
After:
fetch Request: kucoin GET https://openapi-v2.kucoin.com/api/v3/market/orderbook/level2?symbol=BTC-USDT RequestHeaders: {'User-Agent': 'python-requests/2.27.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} RequestBody: None
Used
masked_request_headers = {k:v for k,v in request_headers.items() if not k.startswith('KC-')}
for verbose print