curl:400错误请求。浏览器(或代理)发送了该服务器无法理解的请求

时间:2018-07-12 06:47:31

标签: shell curl

我收到“ 400错误的请求。浏览器(或代理)发送了该服务器无法理解的请求”。用于curl命令。卷曲命令如下,有人可以帮忙吗?

token=jfkdjfdikdjydve83hhd54rsfdghsghktwhdh87
payload_file=test_fortify_scan.zip

curl -X POST https://dnsname/api/scan \
-H "authorization: Bearer $token" \
-H 'content-type: application/json' \
-d '{"projVer": "dev", "language": "java", 
"payloadFile":"$payload_file", "emailList": "myemail@mail.com"}'

1 个答案:

答案 0 :(得分:0)

类似报价问题。看Using curl POST with variables defined in bash script functions

token="jfkdjfdikdjydve83hhd54rsfdghsghktwhdh87"
payload_file="test_fortify_scan.zip"

curl -X POST https://dnsname/api/scan \
-H "authorization: Bearer $token" \
-H 'content-type: application/json' \
-d '{"projVer": "dev", "language": "java",
"payloadFile":"'"$payload_file"'", "emailList": "myemail@mail.com"}'