Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no signature of method - wslite.rest.ContentBuilder.multipart() error - when trying to POST multipart #140

Open
Rubathas opened this issue Jun 2, 2017 · 1 comment

Comments

@Rubathas
Copy link

Rubathas commented Jun 2, 2017

Hi,
I get the following error:
ERROR:groovy.lang.MissingMethodException: No signature of method: wslite.rest.ContentBuilder.multipart() is applicable for argument types: ([B) values: [[102, 105, 108, 101, 65, 114, 114]]

If I try to run the following code:
def client = new RESTClient(url)
def fileArr = new File("xmlResponse.xml").bytes
client.post( path:'/attachment?entityId=298&entityType=EXECUTION') { multipart 'file', fileArr}

and also the same error if I try with this:

def client = new RESTClient(url)
byte[] arrayIn = [102, 105, 108, 101, 65, 114, 114]
client.post( path:'/attachment?entityId=298&entityType=EXECUTION') { multipart 'file', arrayIn}

Any idea why this is giving me an error? I have followed the section:
def response = client.post() {
// call once for each body-part
multipart 'username', 'antony'.bytes
multipart 'files[myfile.png]', myFile.bytes
// specify content-type and filename
multipart 'inputFile', 'test'.bytes, 'image/png', 'test.png'
}

from: https://github.com/jwagenleitner/groovy-wslite

However, I do not understand why the client.post is failing.

Look forward to any ideas/comments.

Thanks,
Rubathas

@HelainSchoonjans
Copy link

Hello Rubathas,

I had this error in one of my modules. That was strange as the code was working in another project. After some investigation, I noticed that the multipart method wasn't found in wslite 1.1.0. Bumping the wslite version to 1.1.2 solved the issue.

Regards,
Hélain Schoonjans

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants