jwagenleitner/groovy-wslite — Issue #36: Unable to Restfully Post String of XML content.
Author: cwhiteley
Created: 2012-01-25 17:58:50+00:00
State: open

So I recently came across your package and have found using it to GET XML content. Now I am starting to test out the POST and can not get past this basic post function. Any ideas on what I might be doing incorrectly? Currently I am using version 0.5.2.

String post(String myXML) throws Exception {

def client

println this.url + this.path2
println myXML
try {
client = new RESTClient(this.url + this.path2)
client.authorization = new HTTPBasicAuthorization(this.username, this.password)

def response = client.post() {
text myXML
}

return response.contentAsString
} catch (Exception e) {
println e.message
return null
}

}

When I attempt to run this I get

No signature of method: wslite.rest.RESTClient.post() is applicable for argument types: (Moodle.SchoolInfo$_post_closure1) values: [Moodle.SchoolInfo$_post_closure1@7846a55e]
Possible solutions: post(groovy.lang.Closure), post(java.util.Map, groovy.lang.Closure), put(groovy.lang.Closure), wait(), get(), wait(long)
null