Skip to main content

Making RESTful API Calls with HTTP

  • Chapter
  • First Online:
  • 4842 Accesses

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    Read up on JSON here: https://json.org

  2. 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. 3.

    See https://github.com/flutter/flutter/issues/34545 for the proposed changes.

  4. 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. 5.

    https://en.wikipedia.org/wiki/Don%27t_repeat_yourself

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Rap Payne

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics