# Retrofit 2.0 Samples

DevFeed: [Retrofit 2.0 Samples](<https://devfeed.tech/articles/retrofit-2-0-samples-31827.md>)

Original publisher: [Read original article](<https://www.metachris.dev/2015/10/retrofit-2-samples/>)

Author: Chris Hager

Published: 2015-10-12T00:00:00Z

Content type: tutorial

Language: en

Sources: [Chris Hager](<https://devfeed.tech/sources/chris-hager.md>)

Topics: [Library](<https://devfeed.tech/topics/library.md>), [API](<https://devfeed.tech/topics/api.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [Java](<https://devfeed.tech/topics/java.md>), [Gson](<https://devfeed.tech/topics/gson.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [Android](<https://devfeed.tech/topics/android.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [JSON](<https://devfeed.tech/topics/json.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [articles](<https://devfeed.tech/tags/articles.md>), [client-library](<https://devfeed.tech/tags/client-library.md>), [github](<https://devfeed.tech/tags/github.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [gson](<https://devfeed.tech/tags/gson.md>), [java](<https://devfeed.tech/tags/java.md>), [json](<https://devfeed.tech/tags/json.md>), [retrofit](<https://devfeed.tech/tags/retrofit.md>)

## AI overview

A tutorial on using Retrofit 2.0 beta to consume HTTP APIs in Java and Android applications. It covers project setup with Gradle, JSON serialization with Gson, API client definitions, and sample GET and POST requests against httpbin.org.

## Source excerpt

This post is about using Retrofit 2.0 (beta) to consume HTTP based APIs. Retrofit is a great and popular API client library for Java (and by extension also for Android) developed by Square. Here's a few links to start things off: Retrofit Homepage Retrofit Source on Github Retrofit Javadoc Blog post about Retrofit 2.0 Source code with samples for this post is available on Github. Retrofit makes it easy to develop API clients by describing API endpoints and the results like this: