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

Updating fields for a resource with the PATCH method

Now we will compose and send an HTTP request to update an existing notification, specifically, to update the value of the displayed_once and displayed_times fields. Because we just want to update two fields, we will use the PATCH method instead of PUT. Make sure you replace 2 with the ID or primary key of an existing notification in your configuration. The code file for the sample is included in the restful_python_2_03_01 folder, in the Flask01/cmd307.txt file:

http PATCH ":5000/service/notifications/2" displayed_once=true displayed_times=1

The following is the equivalent curl command. The code file for the sample is included in the restful_python_2_03_01 folder, in the Flask01/cmd308.txt ...

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