Search code examples
curlgit-bashconsul

Curl not working with leading slash in data,


My workstation is Windows, so I use Git Bash as a shell. This command:

curl -X PUT --data /app/envuser/logs http://consulidc01-dev1:8500/v1/kv/voice/common/logging.path

Actually transmits a value of C:/Program Files (x86)/Git/app/envuser/logs instead of /app/envuser/logs. I've tried using --data-raw and --data-binary without success. I'm not sure if this is a curl issue or a GIT Bash issue. I want to get this working because I have a bash script that uploads all the Console properties. This is the only one not working. How can I prevent the undesired pre-pending of the Windows path?


Solution

  • Solved. It was a GIT Bash issue. Before the curl command:

    export MSYS_NO_PATHCONV=1