Test your knowledge

Let's see whether you can answer the following questions correctly:

  1. Which of the following classes is responsible for rendering the text/html content:
    1. The rest_framework.response.HtmlRenderer class
    2. The rest_framework.response.TextHtmlAPIRenderer class
    3. The rest_framework.response.BrowsableAPIRenderer class
  2. By default, the browsable API uses the following web component library:
    1. Bootstrap
    2. ReactJS
    3. AngularJS
  3. When we enter the URL of an existing resource in a web browser, the browsable API:
    1. Returns a web page with just the JSON response for an HTTP GET request to the resource
    2. Returns a web page with a section that displays the JSON response for an HTTP GET request to the resource and diverse buttons to perform other requests to the resource
    3. Returns a web page with a section that displays the JSON response for an HTTP OPTIONS request to the resource and diverse buttons to perform other requests to the resource
  4. When we enter the URL of a non-existing resource in a web browser, the browsable API:
    1. Renders a web page that displays an HTTP 404 not found header
    2. Displays a plain text message with an HTTP 404 not found error
    3. Renders a web page with the last toy resource that was available
  1. If we enter the following URL, http://localhost:8000/toys/10?format=json, and there is a toy resource whose id is equal to 10, the browsable API will display:
    1. The raw JSON results of an HTTP GET request to http://localhost:8000/toys/
    2. The raw JSON results of an HTTP GET request to http://localhost:8000/toys/10
    3. The same web page that would be rendered if we entered http://localhost:8000/toys/10

 

The rights answers are included in the AppendixSolutions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset