Closed justmobilize closed 6 months ago
This may also resolve: https://github.com/adafruit/Adafruit_CircuitPython_Requests/issues/40
This looks good to me. Thanks for the fix @justmobilize!
I confirmed the duplicated Content-Type header issue with a simple http server and wireshark to view the raw TCP data stream. I tried a few other things before resorting to wireshark, but flask and a few of the other basic server examples I tried made it difficult for me to see the raw request. Many of them treat headers as dictionary-like so it seems to resolve duplicates without much trouble.
I confirmed the fix does successfully get rid of that duplicated header.
All testing was was done on a QTPy ESP32-S2 8.2.9
Thanks for testing! And happy to do this (and I hope a bunch more)
Looks like all requested changes have been addressed. Merging this one. Thanks again for all of your work on this @justmobilize!
When helping a member in the discord channel
#help-with-circuitpython
, I had made the mistake of thinking that this library didn't automatically deal with turning adict
into aurlencoded
string. I had them convert it by hand and try and it worked.As it turns out - it does, but also sends the header
Content-Type: application/x-www-form-urlencoded
, which some systems (Spotify
as one) can't handle getting the header twice.This would fix issue https://github.com/adafruit/Adafruit_CircuitPython_Requests/issues/148
Test:
Using the main branch of
Adafruit_CircuitPython_Requests
, this will return a400
because it sendsContent-Type
twice, using this branch will succeed