-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

D Web Development
By :

Let's use the web framework to implement the note application introduced in the previous chapter.
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 |
---|---|
|
|
|
|
|
|
|
|
|
|
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 the @path
and @method
annotations to specify a different route and HTTP method. The following is an example:
@method(HTTPMethod.GET) @path("logout") void leave() { /* ... */ }
This overrides the default POST
method with GET
and changes the URL path from...
Change the font size
Change margin width
Change background colour