Closed GustavoZiaugra closed 3 months ago
Found the issue:
We were sending a custom header called 'Content-Type' and it was conflicting with the 'content-type' header generated by Tesla.Middleware.JSON...
Sorry about the issue
I was about to reply I am glad you figured it out 💜
Hi, After the patch to the version that included https://github.com/elixir-tesla/tesla/pull/702 we decided to move from HTTPC to FInch as the adapter and now we are facing a strange issue when sending any requests that includes a content as a JSON.
Usually our clients follow the above struct:
All those requests with Finch as adapter and the upper struct for requests that includes JSON body are returning a 400 response from the external services.
Doing a quick look into, looks like Tesla.Middlware.JSON is not encoding the body before send the request as it was made with httpc before. Forcing a manual Jason.encode!(params) was making the request work again.
Is there's some issue with Tesla.Middlware.JSON when using Finch as the adapter? Or there's something missing on our side?
Thanks you in advance, Zig!
Enviroment: