From the course: Java's Toughest Bugs
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Debugging steps - Java Tutorial
From the course: Java's Toughest Bugs
Debugging steps
- [Instructor] Let's find out why the id and email data is going missing. One potential reason is that the data doesn't exist in the first place. Let's call the API to see what the data looks like. Since we make a GET request and there's no authentication behind this API, we can simply access it like a webpage. We'll copy the URL and paste it in a browser. Here's our user data. Another option is to make a cURL request, just like we did with our own API. In the terminal, we'll write curl and the URL. With our data in the terminal, let's take a look. Here we see each user has an id and an email. The id is also populated with a number, 1, 2, 3. Now this API generates random users, so it could be the case that the particular users that were returned to us did not have those attributes. To double check this, we can serialize the data into a string before serializing it into the user object. This will let us look at the…