From the course: Android Development Tips

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Send request parameters with Retrofit

Send request parameters with Retrofit - Android Tutorial

From the course: Android Development Tips

Send request parameters with Retrofit

- [Instructor] In the last couple of tips I've described how to use retrofit, an open source library for making web service calls. I showed how to make calls both synchronously and asynchronously. Now, I'll describe how to send a parameter with the get request so that you can filter the data that's returned from a web service. Let's go back to the web service that I'm using. It's at this URL. This particular web service is defined so that you can pass in a parameter named, category, and you'll filter the data based on the category field. I'll start with question mark for a query string, and then I'll select category equals desserts, and I get back just the desserts, apple pie, cheesecake and so on. I can change that to, entrees, and then I'll get back all the entrees or I can change it to, starters. Now, you have to pass in exactly the right value. For example, if I say, category equals something, I won't get back anything. So, there isn't a lot of error handling with this particular…

Contents