You are importing groovyx.net.http.Method.*
and using Method.POST
, that's why you are getting No such property: Method
.
Replace it with:
http.request(POST) { req -> ... }
... that should do.
Alternatively, you could also change the import to:
import static groovyx.net.http.Method
and continue using Method.POST
.