httpDelete did not send body payload
See original GitHub issueFuel: v1.12.0
I tried to sent HTTP DELETE with JSON body. I checked HttpClient.kt
that it skip body set up for GET, DELETE, HEAD
private fun setDoOutput(connection: HttpURLConnection, method: Method) = when (method) {
Method.GET, Method.DELETE, Method.HEAD -> connection.doOutput = false
Method.POST, Method.PUT, Method.PATCH -> connection.doOutput = true
}
Should we allow Method.DELETE
? Because I have scenario that API need body payload for DELETE.
Same issue #245
Issue Analytics
- State:
- Created 6 years ago
- Comments:32 (4 by maintainers)
Top Results From Across the Web
Is an entity body allowed for an HTTP DELETE request?
A client SHOULD NOT generate content in a DELETE request unless it is ... So while clients can send the payload body, servers...
Read more >HTTP Delete Rest service with request body as payload
Request for this service will be passed by source application in request body as payload and not in query parameters.
Read more >REST - Should you use a body for your HTTP DELETE ...
The RFC states that: A payload within a DELETE request message has no defined semantics; sending a payload body on a DELETE request...
Read more >What is HTTP DELETE Request Method? - ReqBin
Sending a message body on a DELETE request might cause some servers to reject the request. But you still can send data to...
Read more >cURL: DELETE request examples - Marc Nuri
HTTP DELETE request with data. Sending a payload body with a DELETE request is something discouraged and not recommended.
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
I noticed curl response contained HTTP/2 200. I don’t know HttpUrlConnection able to support HTTP/2.
@babedev @simonharrer @kittinunf @SleeplessByte @kmcgill88
Guys I am going to pick this up I have opened a WIP Pr (https://github.com/kittinunf/Fuel/pull/417)
I would really appreciate your feedback and reviews.