Jenkins curl post json. Groovy & Jenkins - capture curl output to a file.