HTTP Requests & JSON
Learn to make HTTP GET, POST, PUT, and DELETE requests to REST APIs and parse JSON responses into Dart objects.
Connect to the Web!
Modern mobile apps constantly interact with the internet to fetch and send data. This is often done using HTTP requests to communicate with web services, also known as APIs (Application Programming Interfaces).
APIs provide a way for different software systems to talk to each other. For example, a weather app uses an API to get the latest forecast.
Get the `http` Package
In Flutter and Dart, the easiest way to make HTTP requests is by using the official http package. First, you need to add it to your project's pubspec.yaml file:
dependencies:
flutter:
sdk: flutter
http: ^1.2.0 # Add this lineAll lessons in this course
- Futures & Async/Await
- HTTP Requests & JSON
- Error Handling in Async
- Streams & Reactive Data