XD-1117: Add urlencode of definition in scripts

The CI server has an outdated version of curl which doesn't
support the --data-urlencode option, so we use python instead
to encode the definition before passing it to curl.