Abstract
Now we know how to create a Flutter app, use external libraries and asynchronously read and write data in JSON format. That actually puts us in a great position to go just one small step forward and exchange data with an API server, something that is absolutely essential if we are going to write real-world apps. Here’s what we need to know:
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
Read up on JSON here: https://json.org
- 2.
This is hotly debated topic. While the HTTP spec is silent, RFC 2616 hints that a body is ignored in a DELETE request but doesn’t explicitly forbid it. Some servers will ignore the body. Other servers will ignore the entire request. While others throw a 400 error. Either test it on your server or play it safe and omit the body.
- 3.
See https://github.com/flutter/flutter/issues/34545 for the proposed changes.
- 4.
The term “typed deserialization pattern” is one that I coined based on suggestions from the Flutter community. You may not find others using it until it catches on.
- 5.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Rap Payne
About this chapter
Cite this chapter
Payne, R. (2019). Making RESTful API Calls with HTTP. In: Beginning App Development with Flutter. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5181-2_11
Download citation
DOI: https://doi.org/10.1007/978-1-4842-5181-2_11
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-5180-5
Online ISBN: 978-1-4842-5181-2
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)