@@ -53,6 +72,22 @@ At it's simplest this looks something like this...
.. include:: ../examples/simpleexample/views.py
:literal:
And we're done. We've now got a fully browseable API, which supports multiple input and output media types, and has all the nice automatic field validation that Django gives us for free.
bash: curl -X POST -H 'X-Requested-With: XMLHttpRequest' --data 'foo=bar' http://api.django-rest-framework.org/simple-example/
{"detail": {"bar": ["This field is required."], "baz": ["This field is required."]}}
.. note::
TODO: Mention adding custom handler methods, but that the defaults will often do what we want already. Document a Resource example, not tied to models.