Open Frietziek opened 6 years ago
I thought I was having the same problem but I was hitting this: #666 #900
In one of my filters I was accessing request.queryParams("locale") Accessing request.queryParams somehow clears request.body
I've the same issue, taking a look at the code in the BeforeFilters.execute, the request delegate is set every time, in Routes and AfterFilters only if it is null.
Exact same issue as @radolang. I have a filter that call request.queryParams("locale") and the request.body() returns "" after. This is a critical bug in my opinion. A blocker in my case. I'm using Spark 2.7.2.
I had the same issue too
My before()
function access to request body(), then I cannot get the body of the request in the controller.
I run sparkjava 2.7.2 in tomcat 9
@hunghoang (or for others since this ticket is super old), I had the same problem. After looking at it for a while, it looks like when using the built in Jetty server it uses a httprequestwrapper which allows you to read the body more than once. So I implemented my own filter so that tomcat would behave the same (I'm unclear why this isn't just part of Spark itself).
Here's the gist of it: https://gist.github.com/markcline/bcf6fd4304449f072991c5a36c70ff08
Hello, i am experiencing the same problem (i think) that this issue opened in 2014: #201
Basically, i have two before filters, that do some processing over request.body(), in the first filter the request come filled with body perfectly, but when the second before filter is executed, the request body comes empty...Also, it comes empty to the controller itself.
if i remove the second filter, it works ok, and come filled to the controller.