Book Image

Dart By Example

By : David Mitchell
Book Image

Dart By Example

By: David Mitchell

Overview of this book

Table of Contents (17 chapters)
Dart By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the web service


Now that the data collection and storage has been re-factored, it is time to build a web service. In some ways, this is similar to the blog server we created previously. However, we want to be ambitious, and so will plan for future development by starting to build a web API for our data.

The REST architecture style is very popular as it is well suited to JSON and being consumed by client web applications.

Note

REST is an architecture style for web services that has gained acceptance as a less complex alternative to WSDL and SOAP.

REST builds on HTTP and uses the verbs GET, POST, PUT, and DELETE. It can use any Internet format as a data type (XML, images, and so on), but usually uses JSON.

There is no agreed standard for RESTful web APIs, as it is a style rather than a protocol. This means that it is very flexible, but it can also be hard to get an answer to questions such as "is this the right way to do it?". The usual advice is to be pragmatic and follow REST as...