O'Reilly logo

D Web Development by Kai Nacke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Converting the note application

Let's use the web framework to implement the note application introduced in the previous chapter.

Naming the handler functions

The handler functions become methods of a new NoteApplication class. The HTTP method is derived from the prefix of the method name as follows:

HTTP method

Prefixes

GET

get, query, getter @property methods, and methods named index

POST

post, create, add, and no prefix

PUT

put, set, and setter @property methods

PATCH

patch and update

DELETE

delete, erase, and remove

Only the GET and POST methods are usually used in web applications, but you should know all the prefixes in order to avoid surprises. The prefix is stripped from the name to form the route.

You can use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required