O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

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

Chapter 7. Working with Web Servers

In this chapter, we will cover the following recipes:

  • Creating a web server
  • Posting JSON-formatted data
  • Receiving data on the web server
  • Serving files with http_server
  • Using sockets
  • Using WebSockets
  • Using secure sockets and servers
  • Using a JSON web service

Introduction

Dart, besides being an excellent web programming language is, also suitable for writing server applications. In this chapter, we will specifically look at Dart's dart:io library to write web servers and their functionality. This library is built to work asynchronously so that the server can handle many requests at the same time (concurrently). It provides the class HttpRequest to write command-line clients. The Dart team also wrote the http_server package ...

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