jgritman / httpbuilder

315 stars 154 forks source link

NoSuchMethodError on binary content with Groovy 3 #91

Open Bert-R opened 3 years ago

Bert-R commented 3 years ago

When receiving a binary response using Groovy 3, the following exception occurs:

java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.DefaultGroovyMethods.leftShift(Ljava/io/OutputStream;Ljava/io/InputStream;)Ljava/io/OutputStream;
    at groovyx.net.http.HTTPBuilder.defaultSuccessHandler(HTTPBuilder.java:620)
    at groovyx.net.http.RESTClient.defaultSuccessHandler(RESTClient.java:246)
...

The response carries the following headers:

Content-Disposition: form-data; name="file"; filename="MyPhoto.jpg"
Content-Type: image/jpeg
Content-Transfer-Encoding: binary
Bert-R commented 3 years ago

Immediately after logging this issue, I found PR #90, which fixes this issue.