我有一个 curl 命令:
curl -u ${USER_ID}:${PASSWORD} -X GET 'http://blah.gso.woo.com:8080/rest/job-execution/job-details/${job_id}'
该变量job_id
中有一个值,例如 1160。当我在 shell 中执行 curl 命令时,它给了我以下错误:
{"message":"Sorry. An unexpected error occured.", "stacktrace":"Bad Request. The request could not be understood by the server due to malformed syntax."}
如果我直接在命令中传递数字'1160',如下所示,curl命令有效。
curl -u ${USER_ID}:${PASSWORD} -X GET 'http://blah.gso.woo.com:8080/rest/job-execution/job-details/1160'
我希望能够在 curl 命令中传递变量的值。