diff options
Diffstat (limited to 'docs/tutorial/4-authentication-and-permissions.md')
| -rw-r--r-- | docs/tutorial/4-authentication-and-permissions.md | 20 | 
1 files changed, 15 insertions, 5 deletions
| diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index 4e4edeea..15d93a62 100644 --- a/docs/tutorial/4-authentication-and-permissions.md +++ b/docs/tutorial/4-authentication-and-permissions.md @@ -198,15 +198,25 @@ If we're interacting with the API programmatically we need to explicitly provide  If we try to create a snippet without authenticating, we'll get an error: -    curl -i -X POST http://127.0.0.1:8000/snippets/ -d "code=print 123" +    http POST http://127.0.0.1:8000/snippets/ code="print 123" -    {"detail": "Authentication credentials were not provided."} +    { +        "detail": "Authentication credentials were not provided." +    }  We can make a successful request by including the username and password of one of the users we created earlier. -    curl -X POST http://127.0.0.1:8000/snippets/ -d "code=print 789" -u tom:password - -    {"id": 5, "owner": "tom", "title": "foo", "code": "print 789", "linenos": false, "language": "python", "style": "friendly"} +    http POST -a tom:password http://127.0.0.1:8000/snippets/ code="print 789" + +    { +        "id": 5, +        "owner": "tom", +        "title": "foo", +        "code": "print 789", +        "linenos": false, +        "language": "python", +        "style": "friendly" +    }  ## Summary | 
