Import dart:convert for access to jsonEncode to encode the data:

Use the http.post() method to send the encoded data:

The http.post() method returns a Future that contains a Response.

Future is a core Dart class for working with
asynchronous operations. A Future object represents a potential
value or error that will be available at some time in the future.

The http.Response class contains the data received from a successful
http call.

The createAlbum() method takes an argument title
that is sent to the server to create an Album.

3. Convert the http.Response to a custom Dart object

While it’s easy to make a network request,
working with a raw Future<http.Response>
isn’t very convenient.  To make your life easier,
convert the http.Response into a Dart object.

Create an Album class