2

I'm getting "400 Bad Request. The browser (or proxy) sent a request that this server could not understand." for the curl command. Curl command is as below, can someone please help?

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"}'
DZone
  • 31
  • 1
  • 5

1 Answers1

1

Looks like quotes problem. Look at 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"}'
lojza
  • 1,823
  • 2
  • 13
  • 23