Hello,
I am trying, for the first time to use curl. I get an error when using the following code “Empty or invalid json”}curl.
curl http://localhost:3000/todos -X POST \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoidG9kb191c2VyIn0.SDjBjuJJxqjEfS84-pyesq5IRdLSzMbAJRbmJ79MOZ8"; \ -H "Content-Type: application/json" \ -d ' { "task": "learn how to auth" } '
This is the specific feedback:
E:\Download\PostgREST\postgrest-v12.0.2-windows-x64\artifacts\postgrest-windows-x64>curl http://localhost:3000/todos -X POST \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoidG9kb191c2VyIn0.SDjBjuJJxqjEfS84-pyesq5IRdLSzMbAJRbmJ79MOZ8"; \ -H "Content-Type: application/json" \ -d ' { "task": "learn how to auth" } '
{"code":"PGRST301","details":null,"hint":null,"message":"JWSError (JSONDecodeError \"Not valid base64url\")"}curl: (3) URL rejected: Bad hostname
curl: (3) URL rejected: Bad hostname
curl: (3) URL rejected: Bad hostname
curl: (3) unmatched brace in URL position 1:
{
^
Can anyone give some insight into what may be wrong with that command?
Thanks,
Tim