apisecurityinaction
apisecurityinaction copied to clipboard
Getting Bad Message 400 - Chapter 3
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
I have employed all the files from Chap3 -end and starting the server , running the above curl command
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