Content-Type application/x-www-form-urlencoded by default
See original GitHub issueHi all!
I updated from 1.14.0 to 1.15.0 and had some issues with all my requests getting broken. Before I was just doing very basic JSON PUT requests, like this
val (request, response, result) = "http://myserver.local/api/v1/test".httpPut()
.header("Content-Type" to "application/json")
.body("{"id":"test","somemorefields":"andvalues", ...")
.response()
with the latest Update to 1.15, this doesn’t work anymore. The Content-Type being sent is then “application/x-www-form-urlencoded; application/json” and my server rejects this.
Is this a nice default behaviour? I wouldn’t expect a default header to be set and my explicitly defined headers sent on the second position only (which makes everything fail now). I guess this whole implementation changed with https://github.com/kittinunf/Fuel/pull/393…
Sidenote for anyone with the same problem: I figured out that the headers can be reset by wrapping them in a map
... .header(mapOf("Content-Type" to "application/json"))...
Kind Regards Matthias
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:6
Top Results From Across the Web
application/x-www-form-urlencoded or multipart/form-data?
application /x-www-form-urlencoded is the default mime-type of your request (see also w3.org/TR/html401/interact/forms.html#h-17.13.4). I use it ...
Read more >Content-Type defaults to "application/x-www-form-urlencoded"
When no Content-Type is provided for POST, PATCH, PUT and default settings of the Fuel instance is applied, each of these requests defaults...
Read more >Send Data by Using a POST Method - Micro Focus
The application/x-www-form-urlencoded content type describes form data that is sent in a single block in the HTTP message body. Unlike the query part...
Read more >POST - HTTP - MDN Web Docs
A simple form using the default application/x-www-form-urlencoded content type: POST /test HTTP/1.1 Host: foo.example Content-Type: ...
Read more >Difference Between form-data, x-www-form-urlencoded and ...
This is also known as the default content type. All the forms submitted with this content type follow the below encoding pattern: The...
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 FreeTop 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
Top GitHub Comments
Looks like
Request.jsonBody
is documented on the README.md, but this is not yet released correct?True