Skip to Content
Python Microservices Development
book

Python Microservices Development

by Tarek Ziadé
July 2017
Beginner to intermediate
340 pages
7h 43m
English
Packt Publishing
Content preview from Python Microservices Development

Response

In the previous examples, we've used the jsonify() function, which creates a Response object from the mapping returned by the view.

The Response object is, technically, a standard WSGI application you could use directly. It's wrapped by Flask, and called with the WSGI's environ, and the start_response function is received from the web server.

When Flask picks a view via its URL mapper, it expects it to return a callable object that can receive the environ and start_response arguments.

This design may seem a little awkward since the WSGI environ is already parsed into a Request object by the time the Response object is called with the WSGI environ again. But, in practice, this is just an implementation detail. When your code needs ...
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

Python Microservices Development - Second Edition

Python Microservices Development - Second Edition

Simon Fraser, Tarek Ziadé
Python Web Development with Sanic

Python Web Development with Sanic

Stephen Sadowski, Adam Hopkins

Publisher Resources

ISBN: 9781785881114Supplemental Content