Fetch data from the internet

Parse JSON in the background

Make authenticated requests

Cookbook

Networking

Make authenticated requests

Add authorization headers

Complete example

To fetch data from most web services, you need to provide
authorization. There are many ways to do this,
but perhaps the most common uses the Authorization HTTP header.

Add authorization headers

The http package provides a
convenient way to add headers to your requests.
Alternatively, use the HttpHeaders
class from the dart:io library.

Complete example

This example builds upon the
Fetching data from the internet recipe.

Fetch data from the internet

Parse JSON in the background