apisecurityinaction icon indicating copy to clipboard operation
apisecurityinaction copied to clipboard

Getting Bad Message 400 - Chapter 3

Open santikris2003 opened this issue 3 years ago • 2 comments

From Chapter 3 when I execute this getting Bad Message 400 , what Im missing here ?

curl -k --cacert "$(./mkcert -CAROOT)/rootCA.pem" -d ‘{"username":"demo","password":"password"}’ -H ‘Content-Type:application/json’ https://localhost:4567/users

curl: (3) URL using bad/illegal format or missing URL

Bad Message 400

reason: Illegal character OTEXT=0xe2

santikris2003 avatar Dec 18 '21 04:12 santikris2003

I have employed all the files from Chap3 -end and starting the server , running the above curl command

santikris2003 avatar Dec 18 '21 04:12 santikris2003

It's hard to know exactly what is going wrong here, but as a guess it looks like the single quotes around parts of the command have been replaced with "smart quotes", which might be causing an issue. Try copy and pasting the following:

curl -k --cacert "$(./mkcert -CAROOT)/rootCA.pem" -d '{"username":"demo","password":"password"}' -H 'Content-Type:application/json' https://localhost:4567/users

NeilMadden avatar Jan 28 '22 11:01 NeilMadden