mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 21:40:13 +03:00
Add "owner=1" to final http example
The http POST command on line 209 currently fails with because it lacks the required key owner. ``` $ http -a admin:password POST http://127.0.0.1:8000/snippets/ code="print 789" HTTP/1.0 400 BAD REQUEST Allow: GET, POST, HEAD, OPTIONS Content-Type: application/json Date: Sat, 14 Mar 2015 16:37:05 GMT Server: WSGIServer/0.2 CPython/3.4.2 Vary: Accept, Cookie X-Frame-Options: SAMEORIGIN { "owner": [ "This field is required." ] } ```
This commit is contained in:
parent
b41808b79a
commit
57ec1655dc
|
@ -206,7 +206,7 @@ If we try to create a snippet without authenticating, we'll get an error:
|
|||
|
||||
We can make a successful request by including the username and password of one of the users we created earlier.
|
||||
|
||||
http -a tom:password POST http://127.0.0.1:8000/snippets/ code="print 789"
|
||||
http -a tom:password POST http://127.0.0.1:8000/snippets/ code="print 789" owner=1
|
||||
|
||||
{
|
||||
"id": 5,
|
||||
|
|
Loading…
Reference in New Issue
Block a user