Git Product home page Git Product logo

Comments (2)

laurenceisla avatar laurenceisla commented on May 19, 2024

What is the exact request you're doing and the response you're getting? If you're seeing an error like "permission denied for sequence..." then you need to grant permissions to the SEQUENCE generated by serial as seen in the Tutorial 1.

from postgrest.

brucer42 avatar brucer42 commented on May 19, 2024

Purely by the tutorial, using secret 01234567012345670123456701234567, running in an emacs shell so using json_pp to print

brucer42@brucer42s-MBP postgrest % curl http://localhost:3000/todos -X POST
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoidG9kb191c2VyIn0.qrlieu5zvSLJcyDFJ_ZoWTbLkDZbVm1LAsdtPKM7J1Y"
-H "Prefer: return=headers-only"
-H "Content-Type: application/json"
-d '{"task": "learn how to auth"}' | json_pp
curl http://localhost:3000/todos -X POST \

 -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoidG9kb191c2VyIn0.qrlieu5zvSLJcyDFJ_ZoWTbLkDZbVm1LAsdtPKM7J1Y"   \
 -H "Prefer: return=headers-only" \
 -H "Content-Type: application/json" \
 -d '{"task": "learn how to auth"}' **| json_pp**

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 29 0 0 100 29 0 534 --:--:-- --:--:-- --:--:-- 537
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/bin/json_pp5.30 line 52.
brucer42@brucer42s-MBP postgrest % curl http://localhost:3000/todos -X POST
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoidG9kb191c2VyIn0.qrlieu5zvSLJcyDFJ_ZoWTbLkDZbVm1LAsdtPKM7J1Y"
-H "Prefer: return=representation"
-H "Content-Type: application/json"
-d '{"task": "learn how to auth"}' | json_pp
curl http://localhost:3000/todos -X POST \

 -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoidG9kb191c2VyIn0.qrlieu5zvSLJcyDFJ_ZoWTbLkDZbVm1LAsdtPKM7J1Y"   \
 -H "Prefer: return=representation" \
 -H "Content-Type: application/json" \
 -d '{"task": "learn how to auth"}' | json_pp

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 90 0 61 100 29 4468 2124 --:--:-- --:--:-- --:--:-- 6923
[
{
"done" : false,
"due" : null,
"id" : 7,
"task" : "learn how to auth"
}
]

brucer42@brucer42s-MBP postgrest %

from postgrest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.