售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Title Page
Copyright and Credits
Hands-On RESTful Python Web Services Second Edition
Dedication
About Packt
Why subscribe?
Packt.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Reader feedback
Customer support
Get in touch
Errata
Reviews
Piracy
Questions
Developing RESTful APIs and Microservices with Flask 1.0.2
Designing a RESTful API to interact with a simple data source
Understanding the tasks performed by each HTTP method
Understanding microservices
Working with lightweight virtual environments
Setting up a virtual environment with Flask and Flask-RESTful
Declaring status codes for the responses with an enumerable
Creating the model
Using a dictionary as a repository
Configuring output fields
Working with resourceful routing on top of Flask pluggable views
Configuring resource routing and endpoints
Making HTTP requests to the Flask API
Working with the curl and httpie command-line tools
Working with GUI tools – Postman and others
Consuming the API with other programming languages
Test your knowledge
Summary
Working with Models, SQLAlchemy, and Hyperlinked APIs in Flask
Designing a RESTful API to interact with a PostgreSQL 10.5 database
Understanding the tasks performed by each HTTP method
Installing packages with the requirements.txt file to simplify our common tasks
Creating the database
Configuring the database
Creating models with their relationships
Creating schemas to validate, serialize, and deserialize models
Combining blueprints with resourceful routing
Understanding and configuring resourceful routing
Registering the blueprint and running migrations
Verifying the contents of the PostgreSQL database
Creating and retrieving related resources
Test your knowledge
Summary
Improving Our API and Adding Authentication to it with Flask
Improving unique constraints in the models
Understanding the differences between the PUT and the PATCH methods
Updating fields for a resource with the PATCH method
Coding a generic pagination class
Adding pagination features
Understanding the steps to add authentication and permissions
Adding a user model
Creating schemas to validate, serialize, and deserialize users
Adding authentication to resources
Creating resource classes to handle users
Running migrations to generate the user table
Composing requests with the necessary authentication
Test your knowledge
Summary
Testing and Deploying an API in a Microservice with Flask
Setting up unit tests with pytest
Creating a database for testing
Creating fixtures to perform setup and teardown tasks for running clean tests
Writing the first round of unit tests
Running unit tests with pytest and checking testing coverage
Improving testing coverage
Understanding strategies for deployments and scalability
Test your knowledge
Summary
Developing RESTful APIs with Django 2.1
Designing a RESTful API to interact with a simple SQLite database
Understanding the tasks performed by each HTTP method
Setting up the virtual environment with Django REST framework
Creating the models
Managing serialization and deserialization
Understanding status codes for the responses
Writing API views
Making HTTP requests to the Django API
Working with command-line tools - curl and httpie
Working with GUI tools - Postman and others
Test your knowledge
Summary
Working with Class-Based Views and Hyperlinked APIs in Django 2.1
Using model serializers to eliminate duplicate code
Working with wrappers to write API views
Using the default parsing and rendering options and moving beyond JSON
Browsing the API
Designing a RESTful API to interact with a complex PostgreSQL 10.5 database
Understanding the tasks performed by each HTTP method
Declaring relationships with the models
Installing packages with the requirements.txt file to work with PostgreSQL
Configuring the database
Running migrations
Verifying the contents of the PostgreSQL database
Managing serialization and deserialization with relationships and hyperlinks
Creating class-based views and using generic classes
Taking advantage of generic class-based views
Working with endpoints for the API
Browsing an API with relationships
Creating and retrieving related resources
Test your knowledge
Summary
Improving Our API and Adding Authentication to it with Django
Adding unique constraints to the models
Updating a single field for a resource with the PATCH method
Taking advantage of pagination
Customizing pagination classes
Understanding authentication, permissions, and throttling
Adding security-related data to the models
Creating a customized permission class for object-level permissions
Persisting the user that makes a request and configuring permission policies
Setting a default value for a new required field in migrations
Composing requests with the necessary authentication
Browsing the API with authentication credentials
Test your knowledge
Summary
Throttling, Filtering, Testing, and Deploying an API with Django 2.1
Installing packages with the requirements.txt file to work with filters, throttling, and tests
Understanding filtering, searching, and ordering classes
Configuring filtering, searching, and ordering for views
Executing HTTP requests to test filtering, searching, and ordering
Filtering, searching and ordering in the Browsable API
Understanding throttling classes and goals
Configuring throttling policies
Executing HTTP requests to test throttling policies
Setting up unit tests with pytest
Writing the first round of unit tests
Running unit tests with pytest
Improving testing coverage
Running Django RESTful APIs on the cloud
Test your knowledge
Summary
Developing RESTful APIs with Pyramid 1.10
Designing a RESTful API to interact with a simple data source
Setting up the virtual environment with Pyramid 1.10
Creating a new Pyramid project based on a template
Creating the model
Using a dictionary as a repository
Creating a Marshmallow schema to validate, serialize, and deserialize the model
Working with view callables and view configurations
Understanding and configuring view handlers
Making HTTP requests to the API with command-line tools
Test your knowledge
Summary
Developing RESTful APIs with Tornado 5.1.1
Designing a RESTful API to interact with slow sensors and actuators
Understanding the tasks performed by each HTTP method
Setting up a virtual environment with Tornado 5.1.1
Creating classes that represent a drone
Writing request handlers
Mapping URL patterns to request handlers
Making HTTP requests to the Tornado API
Working with command-line tools - curl and httpie
Working with GUI tools - Postman and others
Test your knowledge
Summary
Working with Asynchronous Code, Testing, and Deploying an API with Tornado
Understanding synchronous and asynchronous execution
Refactoring code to take advantage of asynchronous decorators
Mapping URL patterns to asynchronous request handlers
Making HTTP requests to the Tornado non-blocking API
Setting up unit tests with pytest
Writing the first round of unit tests
Running unit tests with pytest and checking testing coverage
Improving testing coverage
Understanding strategies for deploying Tornado APIs to the cloud
Test your knowledge
Summary
Assessment
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Other Books You May Enjoy
Leave a review - let other readers know what you think
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜