Chapter Exercise

Design and Build Great Web APIs — by Mike Amundsen (20 / 127)

The Pragmatic Programmers
The Pragmatic Programmers
2 min readApr 28, 2021

--

👈 What’s Next? | TOC | Part 2 The Design Phase 👉

In the previous chapter, we used curl to make a series of API calls (via HTTP) and saved them to disk. Now it’s time to organize those responses into our first Git repository. We’ll use this repository (or repo) to hold all the project-specific materials we’ll be generating in the upcoming chapters.

In the last exercise (see Chapter Exercise), we used curl to make requests to BigCo’s existing services and saved the responses to a folder on our machine called services. We also added a folder with the same name to our Git repo earlier in this chapter (See Adding a New Folder). Now it’s time to put these two exercises together and make sure all our saved curl responses are added to our Git project’s services folder.

Once you add all the responses from the Company, Account, and Activity services to your services folder, use git add and git commit to commit those changes to your local repository. Then use the git push command to push your local changes to the shared GitHub repository in the cloud.

See Appendix 2 (Solution for Chapter 2: Understanding HTTP, REST, and APIs) for the solution.

Footnotes

[14] https://www.w3.org/Protocols/HTTP/AsImplemented.html

[15] https://tools.ietf.org/html/rfc7540

[16] https://www.iana.org/assignments/http-methods/http-methods.xhtml

[17] https://tools.ietf.org/html/rfc5789

[18] https://www.w3.org/History/1989/proposal.html

[19] https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

[20] https://www.ics.uci.edu/~fielding/pubs/dissertation/net_app_arch.htm#sec_2_3

[21] https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_1

[22] https://rhodecode.com/insights/version-control-systems-2016

[23] https://git-scm.com/book/en/v2

Copyright © 2020, The Pragmatic Bookshelf.

👈 What’s Next? | TOC | Part 2 The Design Phase 👉

Design and Build Great Web APIs by Mike Amundsen can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

Unlisted

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.