Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Using Wiremock post ends in IOException Buffer size exceeded

Wiremock is a fantastic tool to simulate a REST-Api. I have tried many examples and they work quite well. But I have a problem while simulating a multipart-post-service. As far as I have understood it correctly this would be the way to configure the stup:

stubFor(post(urlMatching(...some.kind.of.url...)).willReturn(ok()));

I don't want to consider any specifactions of the multipart-request-body, so I think there is no need to use withMultipartRequestBody.But when I post the data I get the following error:

java.io.IOException: Buffer size exceeded: no line terminator at org.eclipse.jetty.util.ReadLineInputStream.readLine(ReadLineInputStream.java:55) at org.eclipse.jetty.util.MultiPartInputStreamParser$Base64InputStream.read(MultiPartInputStreamParser.java:805) at org.eclipse.jetty.util.MultiPartInputStreamParser.parse(MultiPartInputStreamParser.java:638) at org.eclipse.jetty.util.MultiPartInputStreamParser.getParts(MultiPartInputStreamParser.java:400) at org.eclipse.jetty.server.Request.getParts(Request.java:2147) at org.eclipse.jetty.server.Request.getParts(Request.java:2099) at com.github.tomakehurst.wiremock.servlet.WireMockHttpServletRequestAdapter.safelyGetRequestParts(WireMockHttpServletRequestAdapter.java:295)...

How can I solve the problem and why Wiremock starts parsing the http-body?

Comments