Skip to Content
Building RESTful Python Web Services
book

Building RESTful Python Web Services

by Gastón C. Hillar
October 2016
Intermediate to advanced
418 pages
9h 52m
English
Packt Publishing
Content preview from Building RESTful Python Web Services

Declaring status codes for the responses

Tornado allows us to generate responses with any status code that is included in the http.HTTPStatus dictionary. We might use this dictionary to return easy to understand descriptions as the status codes, such as HTTPStatus.OK and HTTPStatus.NOT_FOUND after importing the HTTPStatus dictionary from the http module. These names are easy to understand but they don't include the status code number in their description.

We have been working with many different frameworks and micro-frameworks throughout the book, and therefore, we will borrow the code that declares very useful functions and variables related to HTTP status codes from the status.py file included in Django REST Framework, that is, the framework ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RESTful Python Web Services - Second Edition

Hands-On RESTful Python Web Services - Second Edition

Gastón C. Hillar

Publisher Resources

ISBN: 9781786462251Supplemental Content