Request objects

REST framework introduces a Request object that extends the regular HttpRequest, and provides more flexible request parsing. The core functionality of the Request object is the request.data attribute, which is similar to request.POST, but more useful for working with Web APIs.

  1. request.POST # Only handles form data. Only works for 'POST' method.
  2. request.data # Handles arbitrary data. Works for 'POST', 'PUT' and 'PATCH' methods.