KotlinCS 124 LogoJava

MP2: API Client

Let’s continue work on MP2! Now that we have a server route delivering full course information, let’s add support for it to our API client.

Along the way we’ll continue our discussion of the basics of client-server communication using the HTTP protocol. But we’ll keep this lesson short to give you time to devote to the first set of MP2 test cases.

Client GET /course/ Method
Client GET /course/ Method

In the previous lesson we focused on adding support for a /course/ route to our API server. As a next step forward, we’ll add support for utilizing that route to our API client, but completing the getCourse route. Like the server, we have some starter code to guide us, but we’ll need to make some adjustments.

Before beginning work on the client, your server GET /course/ support should be finished. Specifically, you should pass both test0_CourseClassDesign and test1_ServerCourseRoute.

We’ll also discuss the use of a callback method here, and connect that to the functionality provided by our user interface.

Your Goal Today
Your Goal Today

As a reminder, on lessons where we focus on the machine project we will not assign a homework problem! However, the lesson will usually focus on helping you complete a particular part of the MP test suite, and so we encourage you to spend time on that in lieu of a homework problem.

Right now your goal should be to

  1. complete the API client getCourse method as described above
  2. at that point you’ll be passing test2_ClientGetCourse, and should be able to meet the early deadline

If you get stuck, find us for help on the tutoring site or forum. If you have extra time after today’s lesson, you may want to move on and begin work on the next lesson, which also covers MP2.

MP2 Scores
MP2 Scores