Perfectly working curl command fails when executed in a groovy script

后端 未结 4 771
不思量自难忘°
不思量自难忘° 2021-02-02 11:08

I have a post commit hook (a groovy script) in gitblit to invoke a REST endpoint. In this script I am executing a curl command. But it seems to fail. The curl command works fine

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-02 11:22

    In Curl Post -- In-F option - wrap the entire param with double quotes .Don't forget to escape the double quotes to get syntax right. Example Below:

    def response = "curl -u admin:admin -F\"jcr:content/par/address/address1=2/3 Market Place\" http://localhost:4502/content/datasource/branches".execute().text

提交回复
热议问题