Sorry if this is a duplicate. I was looking for spark.RequestWrapper.getBody() on here and couldnt find what I was looking for. Basically, when I make a post request with 3 body values (name="Something, id="Something", someNumber=1) then call getBody()
, I receive the following.
------WebKitFormBoundaryAFbSXBcWNVOAmQFo
Content-Disposition: form-data; name="name"
"Something"
------WebKitFormBoundaryAFbSXBcWNVOAmQFo
Content-Disposition: form-data; name="id"
"Something"
------WebKitFormBoundaryAFbSXBcWNVOAmQFo
Content-Disposition: form-data; name="someNumber"
1
------WebKitFormBoundaryAFbSXBcWNVOAmQFo--
I believe this actually comes from IOUtils.toByteArray(servletRequest.getInputStream())
, and is cast to a string. Considering it's from servletRequest, I figured this is a pretty common problem, but haven't found a library or solution yet.
Thanks in advance for your help!
P.S. - If this is a duplicate, my apologies. Feel free to flag it and I'll be on my merry way!
Edit - Not Apache Spark. This one: http://sparkjava.com/