$ curl -X POST -d "username=your_username&password=your_password" http://localhost:8000/api/auth/token/
$ curl -H "Authorization: JWT <your_token>" http://localhost:8000/api/posts/create
-
slug
-
type (ex. post)
-
parent_id (optional. But if you post a reply to a comment, it's required.)
Example:
$ curl -X POST -H "Authorization: JWT <your_token_here>" -H "Content-Type: application/json" -d '{"content":"This is a comment."}' 'http://localhost:8000/api/comments/create/?slug=the-slug-of-the-post&type=post'
Example:
$ curl -X POST -H "Authorization: JWT <your_token_here>" -H "Content-Type: application/json" -d '{"content":"This is a comment."}' 'http://localhost:8000/api/comments/create/?slug=the-slug-of-the-post&type=post&parent_id=id_of_the_comment'