Creating items

We can create an item by making a POST request to /items, but before we do so, make sure to create a Shopping List as we just deleted it using the DELETE request. Once you have the Shopping List created, make sure to copy the ID as we will need it to make an item object. When making an item, we need to specify the name, whether it is checked or not, and the Shopping List ID it belongs to. The following is a sample request to create an item and the Response we get back on successful creation:

Great! We just created an item and associated it with a Shopping List. One thing to note is that even though we did not pass the is_checked ...

Get Hands-On Full-Stack Development with Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.