Skip to Content
Hands-On RESTful Python Web Services - Second Edition
book

Hands-On RESTful Python Web Services - Second Edition

by Gastón C. Hillar
December 2018
Intermediate to advanced
500 pages
12h 33m
English
Packt Publishing
Content preview from Hands-On RESTful Python Web Services - Second Edition

Understanding the differences between the PUT and the PATCH methods

The HTTP PUT and PATCH methods have different purposes. The HTTP PUT method is meant to replace an entire resource. The HTTP PATCH method is meant to apply a delta to an existing resource.

Our API is able to update a single field for an existing resource, and therefore, we provide an implementation for the PATCH method. For example, we can use the PATCH method to update an existing notification and set the value for its displayed_once and displayed_times fields to true and 1.

We don't want to use the PUT method to update two fields because this method is meant to replace an entire notification. The PATCH method is meant to apply a delta to an existing notification, and therefore, ...

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

Building RESTful Python Web Services

Building RESTful Python Web Services

Gastón C. Hillar
Python Command Line Tools

Python Command Line Tools

Alfredo Deza, Noah Gift

Publisher Resources

ISBN: 9781789532227Supplemental Content