I'm trying to use Groovy HTTPBuilder to submit a POST request to the
cgi script described here:
http://itol.embl.de/help/batch_help.shtml
And am having a bit of trouble. I've not been able to find a file
upload example, and I'm not very familiar with this kind of thing. How
to I include a file in the post body Map? So far I have a fairly naive
approach:
def treeFile = new File('/home/martin/Desktop/gk/manual.nex.con')
def http = new HTTPBuilder( 'http://itol.embl.de/' )
def postBody = [
treeFile:treeFile,
treeFormat:'nexus',
treeName:'testtree',
]
http.post( path: 'batch_uploader.cgi', body: postBody,
requestContentType: URLENC ) { resp, reader ->
println "response status: ${resp.statusLine}"
System.out << reader // print response stream
}
Any help appreciated.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email