Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python for Google App Engine

You're reading from   Python for Google App Engine Master the full range of development features provided by Google App Engine to build and run scalable web applications in Python

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher Packt
ISBN-13 9781784398194
Length 198 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Massimiliano Pippi Massimiliano Pippi
Author Profile Icon Massimiliano Pippi
Massimiliano Pippi
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Getting Started FREE CHAPTER 2. A More Complex Application 3. Storing and Processing Users' Data 4. Improving Application Performance 5. Storing Data in Google Cloud SQL 6. Using Channels to Implement a Real-time Application 7. Building an Application with Django 8. Exposing a REST API with Google Cloud Endpoints Index

Designing and building the API

Before writing the code, we need to have a neat idea in mind of the resources we are going to make available through the API, the methods we will provide to manipulate such resources, and the response codes we will deliver to the clients. After designing the API, we can start write some code to implement resources representation.

Resources, URLs, HTTP verbs, and response code

Defining a resource is very similar to defining a model class in an ORM system, and it's not uncommon for them to coincide, like in our case. In fact, we will provide the following resources:

  • Note
  • NoteFile
  • ChecklistItem

Every resource will be identified by a URL. We omit the hostname here for clarity:

  • The /notes URL: This identifies a collection of resources of type Note
  • The /notes/:id URL: This identifies a single resource of type Note using its ID as the discriminator
  • The /notefiles URL: This identifies a collection of resources of type NoteFile
  • The /notefiles/:id URL: This identifies a...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime