how to get post content with groovy listening on a port?
- by Amir Raminfar
I wrote the following simple groovy code that handles a request.
if (init)
data = ""
if (line.size() > 0) {
data += "--> " + line + "\n"
} else {
println "HTTP/1.1 200 OK\n"
println data
println "----\n"
return "success"
}
I then run it by doing groovy -l 8888 ServerTest.groovy However, it doesn't seem to print any POST data. I am testing it by doing curl -d "d=test" http://localhost:8888/ Does anybody know how to get that data in groovy?